{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "81a495c5",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy import *\n",
    "from sympy.abc import x,y,z,m,n,t,k,a,b,c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 387,
   "id": "51342ce1",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.stats import Binomial,E,P"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "01ae00d7",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.stats import density,variance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 172,
   "id": "7b1679d6",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.stats import FiniteRV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 277,
   "id": "91dc5c28",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 278,
   "id": "50d50838",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['/home/huang/python_code',\n",
       " '/home/huang/anaconda3/lib/python39.zip',\n",
       " '/home/huang/anaconda3/lib/python3.9',\n",
       " '/home/huang/anaconda3/lib/python3.9/lib-dynload',\n",
       " '',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages/IPython/extensions',\n",
       " '/home/huang/.ipython']"
      ]
     },
     "execution_count": 278,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 279,
   "id": "e78f68d0",
   "metadata": {},
   "outputs": [],
   "source": [
    "sys.path.append(\"/home/huang/Documents/packaging_tutorial/src\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 280,
   "id": "aebc3c8c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['/home/huang/python_code',\n",
       " '/home/huang/anaconda3/lib/python39.zip',\n",
       " '/home/huang/anaconda3/lib/python3.9',\n",
       " '/home/huang/anaconda3/lib/python3.9/lib-dynload',\n",
       " '',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages',\n",
       " '/home/huang/anaconda3/lib/python3.9/site-packages/IPython/extensions',\n",
       " '/home/huang/.ipython',\n",
       " '/home/huang/Documents/packaging_tutorial/src']"
      ]
     },
     "execution_count": 280,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sys.path"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 281,
   "id": "aefeedc9",
   "metadata": {},
   "outputs": [],
   "source": [
    "%load_ext autoreload"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 282,
   "id": "9634cdef",
   "metadata": {},
   "outputs": [],
   "source": [
    "%autoreload 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 289,
   "id": "b0ab065d",
   "metadata": {},
   "outputs": [],
   "source": [
    "%aimport excel_function_package.data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 284,
   "id": "0fe61085",
   "metadata": {},
   "outputs": [],
   "source": [
    "from excel_function_package.data import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "007bc23f",
   "metadata": {},
   "outputs": [],
   "source": [
    "a=Matrix([-3,2,5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "c61015a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "b=Matrix([1,5,-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "6e02fdb9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}0\\\\17\\\\2\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[ 0],\n",
       "[17],\n",
       "[ 2]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a+3*b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "69517af8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 2 & 0\\\\0 & 0 & 1\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[1, 0, 0],\n",
       "[0, 2, 0],\n",
       "[0, 0, 1]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A=Matrix([[1,0,0],[0,2,0],[0,0,1]])\n",
    "A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "8fd9989c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1\\\\1\\\\1\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[1],\n",
       "[1],\n",
       "[1]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B=ones(3,1)\n",
    "B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "aee43bd7",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function ones in module sympy.matrices.dense:\n",
      "\n",
      "ones(*args, **kwargs)\n",
      "    Returns a matrix of ones with ``rows`` rows and ``cols`` columns;\n",
      "    if ``cols`` is omitted a square matrix will be returned.\n",
      "    \n",
      "    See Also\n",
      "    ========\n",
      "    \n",
      "    zeros\n",
      "    eye\n",
      "    diag\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(ones)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "5aa47bbf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1\\\\\\frac{1}{2}\\\\1\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[  1],\n",
       "[1/2],\n",
       "[  1]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A.inv()*B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b3c9795a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}0\\\\1\\\\\\frac{1}{2}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[  0],\n",
       "[  1],\n",
       "[1/2]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C=Matrix([0,1,Rational(1,2)])\n",
    "C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "3f561abd",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['C',\n",
       " 'D',\n",
       " 'H',\n",
       " 'LDLdecomposition',\n",
       " 'LDLsolve',\n",
       " 'LUdecomposition',\n",
       " 'LUdecompositionFF',\n",
       " 'LUdecomposition_Simple',\n",
       " 'LUsolve',\n",
       " 'QRdecomposition',\n",
       " 'QRsolve',\n",
       " 'T',\n",
       " '__abs__',\n",
       " '__add__',\n",
       " '__annotations__',\n",
       " '__array__',\n",
       " '__array_priority__',\n",
       " '__class__',\n",
       " '__delattr__',\n",
       " '__dict__',\n",
       " '__dir__',\n",
       " '__doc__',\n",
       " '__eq__',\n",
       " '__format__',\n",
       " '__ge__',\n",
       " '__getattribute__',\n",
       " '__getitem__',\n",
       " '__gt__',\n",
       " '__hash__',\n",
       " '__init__',\n",
       " '__init_subclass__',\n",
       " '__le__',\n",
       " '__len__',\n",
       " '__lt__',\n",
       " '__matmul__',\n",
       " '__mod__',\n",
       " '__module__',\n",
       " '__mul__',\n",
       " '__ne__',\n",
       " '__neg__',\n",
       " '__new__',\n",
       " '__pow__',\n",
       " '__radd__',\n",
       " '__reduce__',\n",
       " '__reduce_ex__',\n",
       " '__repr__',\n",
       " '__rmatmul__',\n",
       " '__rmul__',\n",
       " '__rsub__',\n",
       " '__setattr__',\n",
       " '__setitem__',\n",
       " '__sizeof__',\n",
       " '__slots__',\n",
       " '__str__',\n",
       " '__sub__',\n",
       " '__subclasshook__',\n",
       " '__truediv__',\n",
       " '__weakref__',\n",
       " '_class_priority',\n",
       " '_diff_wrt',\n",
       " '_dod_to_DomainMatrix',\n",
       " '_eval_Abs',\n",
       " '_eval_Mod',\n",
       " '_eval_add',\n",
       " '_eval_adjoint',\n",
       " '_eval_applyfunc',\n",
       " '_eval_as_real_imag',\n",
       " '_eval_atoms',\n",
       " '_eval_col_del',\n",
       " '_eval_col_insert',\n",
       " '_eval_col_join',\n",
       " '_eval_col_op_add_multiple_to_other_col',\n",
       " '_eval_col_op_multiply_col_by_const',\n",
       " '_eval_col_op_swap',\n",
       " '_eval_conjugate',\n",
       " '_eval_derivative',\n",
       " '_eval_det_bareiss',\n",
       " '_eval_det_berkowitz',\n",
       " '_eval_det_lu',\n",
       " '_eval_determinant',\n",
       " '_eval_diag',\n",
       " '_eval_extract',\n",
       " '_eval_eye',\n",
       " '_eval_free_symbols',\n",
       " '_eval_get_diag_blocks',\n",
       " '_eval_has',\n",
       " '_eval_inverse',\n",
       " '_eval_is_Identity',\n",
       " '_eval_is_anti_symmetric',\n",
       " '_eval_is_diagonal',\n",
       " '_eval_is_lower',\n",
       " '_eval_is_lower_hessenberg',\n",
       " '_eval_is_matrix_hermitian',\n",
       " '_eval_is_symbolic',\n",
       " '_eval_is_symmetric',\n",
       " '_eval_is_upper_hessenberg',\n",
       " '_eval_is_zero_matrix',\n",
       " '_eval_jordan_block',\n",
       " '_eval_matrix_exp_jblock',\n",
       " '_eval_matrix_log_jblock',\n",
       " '_eval_matrix_mul',\n",
       " '_eval_matrix_mul_elementwise',\n",
       " '_eval_matrix_rmul',\n",
       " '_eval_ones',\n",
       " '_eval_permute_cols',\n",
       " '_eval_permute_rows',\n",
       " '_eval_pow_by_cayley',\n",
       " '_eval_pow_by_recursion',\n",
       " '_eval_pow_by_recursion_dotprodsimp',\n",
       " '_eval_row_del',\n",
       " '_eval_row_insert',\n",
       " '_eval_row_join',\n",
       " '_eval_row_op_add_multiple_to_other_row',\n",
       " '_eval_row_op_multiply_row_by_const',\n",
       " '_eval_row_op_swap',\n",
       " '_eval_scalar_mul',\n",
       " '_eval_scalar_rmul',\n",
       " '_eval_simplify',\n",
       " '_eval_todok',\n",
       " '_eval_tolist',\n",
       " '_eval_trace',\n",
       " '_eval_transpose',\n",
       " '_eval_trigsimp',\n",
       " '_eval_values',\n",
       " '_eval_vec',\n",
       " '_eval_vech',\n",
       " '_eval_wilkinson',\n",
       " '_eval_zeros',\n",
       " '_flat_list_to_DomainMatrix',\n",
       " '_format_str',\n",
       " '_fromrep',\n",
       " '_handle_creation_inputs',\n",
       " '_handle_ndarray',\n",
       " '_has_nonnegative_diagonals',\n",
       " '_has_positive_diagonals',\n",
       " '_legacy_array_dot',\n",
       " '_mat',\n",
       " '_matrix_pow_by_jordan_blocks',\n",
       " '_new',\n",
       " '_normalize_op_args',\n",
       " '_op_priority',\n",
       " '_rep',\n",
       " '_repr_disabled',\n",
       " '_repr_latex_',\n",
       " '_repr_png_',\n",
       " '_repr_svg_',\n",
       " '_sage_',\n",
       " '_setitem',\n",
       " '_simplify',\n",
       " '_smat_to_DomainMatrix',\n",
       " '_sympify',\n",
       " '_unify_element_sympy',\n",
       " 'add',\n",
       " 'adjoint',\n",
       " 'adjugate',\n",
       " 'analytic_func',\n",
       " 'applyfunc',\n",
       " 'as_immutable',\n",
       " 'as_mutable',\n",
       " 'as_real_imag',\n",
       " 'atoms',\n",
       " 'berkowitz',\n",
       " 'berkowitz_charpoly',\n",
       " 'berkowitz_det',\n",
       " 'berkowitz_eigenvals',\n",
       " 'berkowitz_minors',\n",
       " 'bidiagonal_decomposition',\n",
       " 'bidiagonalize',\n",
       " 'charpoly',\n",
       " 'cholesky',\n",
       " 'cholesky_solve',\n",
       " 'cofactor',\n",
       " 'cofactorMatrix',\n",
       " 'cofactor_matrix',\n",
       " 'col',\n",
       " 'col_del',\n",
       " 'col_insert',\n",
       " 'col_join',\n",
       " 'col_op',\n",
       " 'col_swap',\n",
       " 'cols',\n",
       " 'columnspace',\n",
       " 'companion',\n",
       " 'condition_number',\n",
       " 'conjugate',\n",
       " 'connected_components',\n",
       " 'connected_components_decomposition',\n",
       " 'copy',\n",
       " 'copyin_list',\n",
       " 'copyin_matrix',\n",
       " 'cross',\n",
       " 'det',\n",
       " 'det_LU_decomposition',\n",
       " 'det_bareis',\n",
       " 'diag',\n",
       " 'diagonal',\n",
       " 'diagonal_solve',\n",
       " 'diagonalize',\n",
       " 'diff',\n",
       " 'doit',\n",
       " 'dot',\n",
       " 'dual',\n",
       " 'echelon_form',\n",
       " 'eigenvals',\n",
       " 'eigenvects',\n",
       " 'elementary_col_op',\n",
       " 'elementary_row_op',\n",
       " 'equals',\n",
       " 'evalf',\n",
       " 'exp',\n",
       " 'expand',\n",
       " 'extract',\n",
       " 'eye',\n",
       " 'fill',\n",
       " 'flat',\n",
       " 'free_symbols',\n",
       " 'gauss_jordan_solve',\n",
       " 'get_diag_blocks',\n",
       " 'has',\n",
       " 'hstack',\n",
       " 'integrate',\n",
       " 'inv',\n",
       " 'inv_mod',\n",
       " 'inverse_ADJ',\n",
       " 'inverse_BLOCK',\n",
       " 'inverse_CH',\n",
       " 'inverse_GE',\n",
       " 'inverse_LDL',\n",
       " 'inverse_LU',\n",
       " 'inverse_QR',\n",
       " 'irregular',\n",
       " 'is_Identity',\n",
       " 'is_Matrix',\n",
       " 'is_MatrixExpr',\n",
       " 'is_anti_symmetric',\n",
       " 'is_diagonal',\n",
       " 'is_diagonalizable',\n",
       " 'is_echelon',\n",
       " 'is_hermitian',\n",
       " 'is_indefinite',\n",
       " 'is_lower',\n",
       " 'is_lower_hessenberg',\n",
       " 'is_negative_definite',\n",
       " 'is_negative_semidefinite',\n",
       " 'is_nilpotent',\n",
       " 'is_positive_definite',\n",
       " 'is_positive_semidefinite',\n",
       " 'is_square',\n",
       " 'is_strongly_diagonally_dominant',\n",
       " 'is_symbolic',\n",
       " 'is_symmetric',\n",
       " 'is_upper',\n",
       " 'is_upper_hessenberg',\n",
       " 'is_weakly_diagonally_dominant',\n",
       " 'is_zero',\n",
       " 'is_zero_matrix',\n",
       " 'jacobian',\n",
       " 'jordan_block',\n",
       " 'jordan_cell',\n",
       " 'jordan_cells',\n",
       " 'jordan_form',\n",
       " 'key2bounds',\n",
       " 'key2ij',\n",
       " 'kind',\n",
       " 'left_eigenvects',\n",
       " 'limit',\n",
       " 'log',\n",
       " 'lower_triangular',\n",
       " 'lower_triangular_solve',\n",
       " 'minor',\n",
       " 'minorEntry',\n",
       " 'minorMatrix',\n",
       " 'minor_submatrix',\n",
       " 'multiply',\n",
       " 'multiply_elementwise',\n",
       " 'n',\n",
       " 'norm',\n",
       " 'normalized',\n",
       " 'nullspace',\n",
       " 'one',\n",
       " 'ones',\n",
       " 'orthogonalize',\n",
       " 'per',\n",
       " 'permute',\n",
       " 'permuteBkwd',\n",
       " 'permuteFwd',\n",
       " 'permute_cols',\n",
       " 'permute_rows',\n",
       " 'pinv',\n",
       " 'pinv_solve',\n",
       " 'pow',\n",
       " 'print_nonzero',\n",
       " 'project',\n",
       " 'rank',\n",
       " 'rank_decomposition',\n",
       " 'refine',\n",
       " 'replace',\n",
       " 'reshape',\n",
       " 'rmultiply',\n",
       " 'rot90',\n",
       " 'row',\n",
       " 'row_del',\n",
       " 'row_insert',\n",
       " 'row_join',\n",
       " 'row_op',\n",
       " 'row_swap',\n",
       " 'rows',\n",
       " 'rowspace',\n",
       " 'rref',\n",
       " 'shape',\n",
       " 'simplify',\n",
       " 'singular_value_decomposition',\n",
       " 'singular_values',\n",
       " 'solve',\n",
       " 'solve_least_squares',\n",
       " 'strongly_connected_components',\n",
       " 'strongly_connected_components_decomposition',\n",
       " 'subs',\n",
       " 'table',\n",
       " 'todod',\n",
       " 'todok',\n",
       " 'tolist',\n",
       " 'trace',\n",
       " 'transpose',\n",
       " 'upper_hessenberg_decomposition',\n",
       " 'upper_triangular',\n",
       " 'upper_triangular_solve',\n",
       " 'values',\n",
       " 'vec',\n",
       " 'vech',\n",
       " 'vstack',\n",
       " 'wilkinson',\n",
       " 'xreplace',\n",
       " 'zero',\n",
       " 'zeros',\n",
       " 'zip_row_op']"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dir(A)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "703b3279",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}\\frac{4 \\sqrt{5}}{15}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([[4*sqrt(5)/15]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(A.inv()*B).T*C/((A.inv()*B).norm(2)*C.norm(2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "b1021d08",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}\\frac{4}{9}\\\\\\frac{2}{9}\\\\\\frac{4}{9}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[4/9],\n",
       "[2/9],\n",
       "[4/9]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(A.inv()*B)/((A.inv()*B).norm(2))**2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "debc3f87",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 2 & 0\\\\2 - 3 x & 2 - 2 x & \\sqrt{3} x\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[      1,       0,         0],\n",
       "[      0,       2,         0],\n",
       "[2 - 3*x, 2 - 2*x, sqrt(3)*x]])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A=Matrix([[1,0,0],[0,2,0],[2-3*x,2-2*x,sqrt(3)*x]])\n",
    "A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "aa468397",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}2 \\sqrt{3} x\\\\\\sqrt{3} x\\\\8 x - 4\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[2*sqrt(3)*x],\n",
       "[  sqrt(3)*x],\n",
       "[    8*x - 4]])"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "N=simplify(A.inv()*B)*2*sqrt(3)*x\n",
    "N"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "07ce68a4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{8 x - 4}{\\sqrt{15 \\left|{x}\\right|^{2} + \\left|{8 x - 4}\\right|^{2}}}$"
      ],
      "text/plain": [
       "(8*x - 4)/sqrt(15*Abs(x)**2 + Abs(8*x - 4)**2)"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "N.dot(Matrix([0,0,1]))/(N.norm(2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "5171a5a8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left\\{\\frac{1}{3}\\right\\}$"
      ],
      "text/plain": [
       "{1/3}"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solveset(N.dot(Matrix([0,0,1]))/(N.norm(2))+4/sqrt(31),x,Reals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "633a97b8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}2 \\sqrt{2} & -2 & 0\\\\0 & 2 & 0\\\\0 & 0 & 2\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[2*sqrt(2), -2, 0],\n",
       "[        0,  2, 0],\n",
       "[        0,  0, 2]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A=Matrix([[2*sqrt(2),-2,0],[0,2,0],[0,0,2]])\n",
    "A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "55cc5850",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}4 \\sqrt{2} & 2 & 0\\\\4 \\sqrt{2} & 2 & 0\\\\4 \\sqrt{2} & 2 & 0\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[4*sqrt(2), 2, 0],\n",
       "[4*sqrt(2), 2, 0],\n",
       "[4*sqrt(2), 2, 0]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B=Matrix([4*sqrt(2),2,0]*3).reshape(3,3)\n",
    "B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "bf5ece44",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}\\frac{\\sqrt{2}}{8}\\\\\\frac{1}{8}\\\\\\frac{1}{8}\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[sqrt(2)/8],\n",
       "[      1/8],\n",
       "[      1/8]])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "answer_D=(B-A).inv()*Matrix([1,1,1])\n",
    "answer_D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "d6e08b47",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}2 \\sqrt{2}\\\\2\\\\2\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[2*sqrt(2)],\n",
       "[        2],\n",
       "[        2]])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "answer_D/(answer_D.norm(2))**2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "f603d471",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 4$"
      ],
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_.norm(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "eed38891",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{4 \\left|{x}\\right|}{\\left|{x}\\right| + 1}$"
      ],
      "text/plain": [
       "4*Abs(x)/(Abs(x) + 1)"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr=4*abs(x)/(1+abs(x))\n",
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "4467d31a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left(1, 2\\right)$"
      ],
      "text/plain": [
       "Interval.open(1, 2)"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solveset(expr.subs(x,2*x-3)<2,x,Reals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7d7a8b2e",
   "metadata": {},
   "outputs": [],
   "source": [
    "X=Binomial(\"X\",4,Rational(2,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "2e9ac168",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{8}{9}$"
      ],
      "text/plain": [
       "8/9"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "P(X>=2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "2db62d20",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 1/81, 1: 8/81, 2: 8/27, 3: 32/81, 4: 16/81}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "density(X).dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "9c01fcca",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on list object:\n",
      "\n",
      "class list(object)\n",
      " |  list(iterable=(), /)\n",
      " |  \n",
      " |  Built-in mutable sequence.\n",
      " |  \n",
      " |  If no argument is given, the constructor creates a new empty list.\n",
      " |  The argument must be an iterable if specified.\n",
      " |  \n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  __add__(self, value, /)\n",
      " |      Return self+value.\n",
      " |  \n",
      " |  __contains__(self, key, /)\n",
      " |      Return key in self.\n",
      " |  \n",
      " |  __delitem__(self, key, /)\n",
      " |      Delete self[key].\n",
      " |  \n",
      " |  __eq__(self, value, /)\n",
      " |      Return self==value.\n",
      " |  \n",
      " |  __ge__(self, value, /)\n",
      " |      Return self>=value.\n",
      " |  \n",
      " |  __getattribute__(self, name, /)\n",
      " |      Return getattr(self, name).\n",
      " |  \n",
      " |  __getitem__(...)\n",
      " |      x.__getitem__(y) <==> x[y]\n",
      " |  \n",
      " |  __gt__(self, value, /)\n",
      " |      Return self>value.\n",
      " |  \n",
      " |  __iadd__(self, value, /)\n",
      " |      Implement self+=value.\n",
      " |  \n",
      " |  __imul__(self, value, /)\n",
      " |      Implement self*=value.\n",
      " |  \n",
      " |  __init__(self, /, *args, **kwargs)\n",
      " |      Initialize self.  See help(type(self)) for accurate signature.\n",
      " |  \n",
      " |  __iter__(self, /)\n",
      " |      Implement iter(self).\n",
      " |  \n",
      " |  __le__(self, value, /)\n",
      " |      Return self<=value.\n",
      " |  \n",
      " |  __len__(self, /)\n",
      " |      Return len(self).\n",
      " |  \n",
      " |  __lt__(self, value, /)\n",
      " |      Return self<value.\n",
      " |  \n",
      " |  __mul__(self, value, /)\n",
      " |      Return self*value.\n",
      " |  \n",
      " |  __ne__(self, value, /)\n",
      " |      Return self!=value.\n",
      " |  \n",
      " |  __repr__(self, /)\n",
      " |      Return repr(self).\n",
      " |  \n",
      " |  __reversed__(self, /)\n",
      " |      Return a reverse iterator over the list.\n",
      " |  \n",
      " |  __rmul__(self, value, /)\n",
      " |      Return value*self.\n",
      " |  \n",
      " |  __setitem__(self, key, value, /)\n",
      " |      Set self[key] to value.\n",
      " |  \n",
      " |  __sizeof__(self, /)\n",
      " |      Return the size of the list in memory, in bytes.\n",
      " |  \n",
      " |  append(self, object, /)\n",
      " |      Append object to the end of the list.\n",
      " |  \n",
      " |  clear(self, /)\n",
      " |      Remove all items from list.\n",
      " |  \n",
      " |  copy(self, /)\n",
      " |      Return a shallow copy of the list.\n",
      " |  \n",
      " |  count(self, value, /)\n",
      " |      Return number of occurrences of value.\n",
      " |  \n",
      " |  extend(self, iterable, /)\n",
      " |      Extend list by appending elements from the iterable.\n",
      " |  \n",
      " |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      " |      Return first index of value.\n",
      " |      \n",
      " |      Raises ValueError if the value is not present.\n",
      " |  \n",
      " |  insert(self, index, object, /)\n",
      " |      Insert object before index.\n",
      " |  \n",
      " |  pop(self, index=-1, /)\n",
      " |      Remove and return item at index (default last).\n",
      " |      \n",
      " |      Raises IndexError if list is empty or index is out of range.\n",
      " |  \n",
      " |  remove(self, value, /)\n",
      " |      Remove first occurrence of value.\n",
      " |      \n",
      " |      Raises ValueError if the value is not present.\n",
      " |  \n",
      " |  reverse(self, /)\n",
      " |      Reverse *IN PLACE*.\n",
      " |  \n",
      " |  sort(self, /, *, key=None, reverse=False)\n",
      " |      Sort the list in ascending order and return None.\n",
      " |      \n",
      " |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n",
      " |      order of two equal elements is maintained).\n",
      " |      \n",
      " |      If a key function is given, apply it once to each list item and sort them,\n",
      " |      ascending or descending, according to their function values.\n",
      " |      \n",
      " |      The reverse flag can be set to sort in descending order.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods defined here:\n",
      " |  \n",
      " |  __class_getitem__(...) from builtins.type\n",
      " |      See PEP 585\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods defined here:\n",
      " |  \n",
      " |  __new__(*args, **kwargs) from builtins.type\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes defined here:\n",
      " |  \n",
      " |  __hash__ = None\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help([])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "8bfa855b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.25, 9.3, 9.35, 9.4, 9.42, 9.48, 9.54, 9.55, 9.7, 9.8]"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a=[9.8,9.7,9.55,9.54,9.48,9.42,9.4,9.35,9.3,9.25]\n",
    "data_a.sort()\n",
    "data_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "77c5899d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.23, 9.32, 9.36, 9.51, 9.56, 9.78]"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b=[9.78,9.56,9.51,9.36,9.32,9.23]\n",
    "data_b.sort()\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "e68410cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.16, 9.2, 9.65, 9.85]"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_c=[9.85,9.65,9.2,9.16]\n",
    "data_c.sort()\n",
    "data_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "3026e515",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.stats import Bernoulli"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "47477c47",
   "metadata": {},
   "outputs": [],
   "source": [
    "X=Bernoulli(\"X\",Rational(2,5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "9b0613b3",
   "metadata": {},
   "outputs": [],
   "source": [
    "Y=Bernoulli(\"Y\",Rational(1,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "68d10ba2",
   "metadata": {},
   "outputs": [],
   "source": [
    "Z=Bernoulli(\"Z\",Rational(1,2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "c213b3ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "Q=X+Y+Z"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "72f24513",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{0: 3/20, 1: 2/5, 2: 7/20, 3: 1/10}"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "density(Q).dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "b18f0756",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{7}{5}$"
      ],
      "text/plain": [
       "7/5"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "E(Q)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "16a9b23b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "05271831",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 9.479$"
      ],
      "text/plain": [
       "9.47900000000000"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_a)/S(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "eb32a6ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 9.465$"
      ],
      "text/plain": [
       "9.46500000000000"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_c)/S(4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "5c41088a",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_a=[9,10,12,13,15,20,26,28]\n",
    "data_b=[9,14,15,18,19,17,16,20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "id": "fad1dbf8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9, 14, 15, 16, 17, 18, 19, 20]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b.sort()\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "id": "abfad853",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16.625"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_a)/8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "5f65aa1c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16.0"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_b)/8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "id": "9aac8b5d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}23 & 2\\\\47 & 28\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[23,  2],\n",
       "[47, 28]])"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_M=Matrix([[23,2],[47,28]])\n",
    "data_M"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "9fa21663",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 25$"
      ],
      "text/plain": [
       "25"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_M[0,:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "0801b20e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{484}{63}$"
      ],
      "text/plain": [
       "484/63"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(det(data_M))**2*sum(data_M)/(sum(data_M[0,:])*sum(data_M[1,:])*sum(data_M[:,0])*sum(data_M[:,1]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "42609e6f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7.682539682539683"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "484/63"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86a7266c",
   "metadata": {},
   "source": [
    "#### 遇到了一个非常有趣的问题"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b79ea11c",
   "metadata": {},
   "source": [
    "这个问题2022年高考北京卷18题里的第3问。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "53e7449c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "id": "fc208f9e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.25, 9.3, 9.35, 9.4, 9.42, 9.48, 9.54, 9.55, 9.7, 9.8]"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a=[9.8,9.7,9.55,9.54,9.48,9.42,9.4,9.35,9.3,9.25]\n",
    "data_a.sort()\n",
    "data_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "c90fd3f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.23, 9.32, 9.36, 9.51, 9.56, 9.78]"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b=[9.78,9.56,9.51,9.36,9.32,9.23]\n",
    "data_b.sort()\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "id": "0ae9bc4b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[9.16, 9.2, 9.33, 9.85]"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_c=[9.85,9.33,9.2,9.16]\n",
    "data_c.sort()\n",
    "data_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "id": "f8cf6dab",
   "metadata": {},
   "outputs": [],
   "source": [
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "def333f9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test=4\n",
    "test==4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "id": "f9cb81cf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[200034, 199850, 200265, 199364, 200487]\n"
     ]
    }
   ],
   "source": [
    "test_list=[0,1,2,3,4]\n",
    "count=[0,0,0,0,0]\n",
    "for i in range(1000000):\n",
    "    count[random.choice(test_list)]+=1\n",
    "print(count)\n",
    "    \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "id": "98217599",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[39373, 34077, 26550]\n"
     ]
    }
   ],
   "source": [
    "n=100000\n",
    "count=[0,0,0]\n",
    "for i in range(n):\n",
    "    choose_a=random.choice(data_a)\n",
    "    choose_b=random.choice(data_b)\n",
    "    choose_c=random.choice(data_c)\n",
    "    # print(choose_a,choose_b,choose_c)\n",
    "    if (choose_a==choose_b or  choose_a==choose_c or choose_b==choose_c):\n",
    "        i-=1\n",
    "        print(\"Error\")\n",
    "    if (choose_a>choose_b and choose_a>choose_c):\n",
    "        count[0]+=1\n",
    "    elif (choose_b>choose_c):\n",
    "        count[1]+=1\n",
    "    else:\n",
    "        count[2]+=1\n",
    "print(count)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "id": "6ffe8b43",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{5}{12}$"
      ],
      "text/plain": [
       "5/12"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rational(416931/1000000).limit_denominator(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8adab96d",
   "metadata": {},
   "source": [
    "如果是data_a,data_c相互比拼的话，就又是一个结果。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "id": "7723bf2b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[275042, 0, 224958]\n"
     ]
    }
   ],
   "source": [
    "n=500000\n",
    "count=[0,0,0]\n",
    "for i in range(n):\n",
    "    choose_a=random.choice(data_a)\n",
    "    # choose_b=random.choice(data_b)\n",
    "    choose_c=random.choice(data_c)\n",
    "    # print(choose_a,choose_b,choose_c)\n",
    "    if (choose_a>choose_c):\n",
    "        count[0]+=1\n",
    "    else:\n",
    "        count[2]+=1\n",
    "print(count)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ee137f16",
   "metadata": {},
   "source": [
    "我在校对参考答案的时候和参考答案产生了分歧。虽然从一开始我是觉得这个题本身就非常的不严谨，一度都在心里产生了不想认真校对的心理，但是看到参考答案在说理方面“错的离谱”后，我产生了一些新的问题和想法：\n",
    "\n",
    "> 如果按照频率等于概率的话\n",
    "\n",
    "甲和乙中随机取一个数，甲大于乙（若平局再来）与乙大于甲的概率，会与统计量对映的概率分布推导的结果出现出入吗？\n",
    "\n",
    "同时，是不是当这些离散随机数变多（并不弥散）后，也会与统计量对映的概率分布结果趋同？"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2f4a2bbc",
   "metadata": {},
   "source": [
    "##### 正常的解题方法"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "80f789cd",
   "metadata": {},
   "source": [
    "一般来讲，肯定是先要有一个概率模型的"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b271b864",
   "metadata": {},
   "source": [
    "###### 等概率分布假设"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "23011bf0",
   "metadata": {},
   "source": [
    "假设他们的成绩在统计值的区间内是等概率分布的，那么在这种情况下，变成了三维的古典概型问题。由于我实在是对三维空间的可行域体积看的脑袋疼，所以还是使用了蒙特卡洛方法，发现与前面非常规解法的结果是一致的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "44ba565c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.251663669796354"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "choose_a=random.uniform(data_a[0],data_a[9])\n",
    "choose_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "id": "13137a79",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method uniform in module random:\n",
      "\n",
      "uniform(a, b) method of random.Random instance\n",
      "    Get a random number in the range [a, b) or [a, b] depending on rounding.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.uniform)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "id": "ca0ca8c0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.3333\n"
     ]
    }
   ],
   "source": [
    "count=0\n",
    "n=10000\n",
    "for i in range(n):\n",
    "    test_a=random.uniform(0,1)\n",
    "    if test_a<=Rational(1,3):\n",
    "        count+=1\n",
    "print(count/n)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "4e32a4e9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[349440, 298287, 352273]\n"
     ]
    }
   ],
   "source": [
    "n=1000000\n",
    "count=[0,0,0]\n",
    "for i in range(n):\n",
    "    choose_a=random.uniform(data_a[0],data_a[9])\n",
    "    choose_b=random.uniform(data_b[0],data_b[5])\n",
    "    choose_c=random.uniform(data_c[0],data_c[3])\n",
    "    # print(choose_a,choose_b,choose_c)\n",
    "    if (choose_a==choose_b or  choose_a==choose_c or choose_b==choose_c):\n",
    "        i-=1\n",
    "        # print(\"Error\")\n",
    "        continue\n",
    "    if (choose_a>choose_b and choose_a>choose_c):\n",
    "        count[0]+=1\n",
    "    elif (choose_b>choose_c):\n",
    "        count[1]+=1\n",
    "    else:\n",
    "        count[2]+=1\n",
    "print(count)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1d1346e",
   "metadata": {},
   "source": [
    "######  正态分布假设"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "id": "5914bf9c",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 9.479$"
      ],
      "text/plain": [
       "9.47900000000000"
      ]
     },
     "execution_count": 103,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "average_a=sum(data_a)/S(10)\n",
    "average_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "id": "0844c845",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}9.479 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\0 & 9.479 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\0 & 0 & 9.479 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 9.479 & 0 & 0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 9.479 & 0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 9.479 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 9.479 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 9.479 & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 9.479 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 9.479\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[9.479,     0,     0,     0,     0,     0,     0,     0,     0,     0],\n",
       "[    0, 9.479,     0,     0,     0,     0,     0,     0,     0,     0],\n",
       "[    0,     0, 9.479,     0,     0,     0,     0,     0,     0,     0],\n",
       "[    0,     0,     0, 9.479,     0,     0,     0,     0,     0,     0],\n",
       "[    0,     0,     0,     0, 9.479,     0,     0,     0,     0,     0],\n",
       "[    0,     0,     0,     0,     0, 9.479,     0,     0,     0,     0],\n",
       "[    0,     0,     0,     0,     0,     0, 9.479,     0,     0,     0],\n",
       "[    0,     0,     0,     0,     0,     0,     0, 9.479,     0,     0],\n",
       "[    0,     0,     0,     0,     0,     0,     0,     0, 9.479,     0],\n",
       "[    0,     0,     0,     0,     0,     0,     0,     0,     0, 9.479]])"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(average_a)*eye(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 169,
   "id": "b3894ad8",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 0.173682340943331$"
      ],
      "text/plain": [
       "0.173682340943331"
      ]
     },
     "execution_count": 169,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stdev_a=sqrt(sum((diag(*data_a)-average_a*eye(10))**2)/(10-1))\n",
    "stdev_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 182,
   "id": "e1a8a35c",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 9.46$"
      ],
      "text/plain": [
       "9.46000000000000"
      ]
     },
     "execution_count": 182,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "average_b=sum(data_b)/S(6)\n",
    "average_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 183,
   "id": "cf29180c",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}9.46 & 0 & 0 & 0 & 0 & 0\\\\0 & 9.46 & 0 & 0 & 0 & 0\\\\0 & 0 & 9.46 & 0 & 0 & 0\\\\0 & 0 & 0 & 9.46 & 0 & 0\\\\0 & 0 & 0 & 0 & 9.46 & 0\\\\0 & 0 & 0 & 0 & 0 & 9.46\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[9.46,    0,    0,    0,    0,    0],\n",
       "[   0, 9.46,    0,    0,    0,    0],\n",
       "[   0,    0, 9.46,    0,    0,    0],\n",
       "[   0,    0,    0, 9.46,    0,    0],\n",
       "[   0,    0,    0,    0, 9.46,    0],\n",
       "[   0,    0,    0,    0,    0, 9.46]])"
      ]
     },
     "execution_count": 183,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(average_b)*eye(6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "id": "55818182",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 0.198695747312316$"
      ],
      "text/plain": [
       "0.198695747312316"
      ]
     },
     "execution_count": 188,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stdev_b=sqrt(sum((diag(*data_b)-average_b*eye(6))**2)/(6-1))\n",
    "stdev_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f3d3fca0",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "id": "a98af156",
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 9.385$"
      ],
      "text/plain": [
       "9.38500000000000"
      ]
     },
     "execution_count": 185,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "average_c=sum(data_c)/S(4)\n",
    "average_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 187,
   "id": "67a1df26",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}9.385 & 0 & 0 & 0\\\\0 & 9.385 & 0 & 0\\\\0 & 0 & 9.385 & 0\\\\0 & 0 & 0 & 9.385\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[9.385,     0,     0,     0],\n",
       "[    0, 9.385,     0,     0],\n",
       "[    0,     0, 9.385,     0],\n",
       "[    0,     0,     0, 9.385]])"
      ]
     },
     "execution_count": 187,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(average_c)*eye(4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 189,
   "id": "ca8e75c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 0.31838132273528$"
      ],
      "text/plain": [
       "0.318381322735280"
      ]
     },
     "execution_count": 189,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stdev_c=sqrt(sum((diag(*data_c)-average_c*eye(4))**2)/(4-1))\n",
    "stdev_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 167,
   "id": "b70b87e6",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method gauss in module random:\n",
      "\n",
      "gauss(mu, sigma) method of random.Random instance\n",
      "    Gaussian distribution.\n",
      "    \n",
      "    mu is the mean, and sigma is the standard deviation.  This is\n",
      "    slightly faster than the normalvariate() function.\n",
      "    \n",
      "    Not thread-safe without a lock around calls.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.gauss)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 193,
   "id": "878ab350",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[36724, 33727, 29549]\n"
     ]
    }
   ],
   "source": [
    "n=100000\n",
    "count=[0,0,0]\n",
    "for i in range(n):\n",
    "    choose_a=random.gauss(average_a,stdev_a)\n",
    "    choose_b=random.gauss(average_b,stdev_b)\n",
    "    choose_c=random.gauss(average_c,stdev_c)\n",
    "    # print(choose_a,choose_b,choose_c)\n",
    "    if (choose_a==choose_b or  choose_a==choose_c or choose_b==choose_c):\n",
    "        i-=1\n",
    "        # print(\"Error\")\n",
    "        continue\n",
    "    if (choose_a>choose_b and choose_a>choose_c):\n",
    "        count[0]+=1\n",
    "    elif (choose_b>choose_c):\n",
    "        count[1]+=1\n",
    "    else:\n",
    "        count[2]+=1\n",
    "print(count)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3b164574",
   "metadata": {},
   "source": [
    "#####  非正常的解题方法"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4aaa5d48",
   "metadata": {},
   "source": [
    "按照频率就是概率的要求，直接认为这次比赛中，每位选手的成绩只可能是过去有统计的成绩中的一个，而且每个成绩是等可能出现的。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0391a20b",
   "metadata": {},
   "source": [
    "按照这样的估计方法，出现了一些非常让人匪夷所思的现象（前面直接用模拟的方法给出了）：\n",
    "\n",
    "**如果是甲和丙单挑的话，甲最后获胜的概率大于丙。但是如果是甲、乙、丙三个人三挑，那么反而是丙最后获胜的概率最大。**\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8e021d3a",
   "metadata": {},
   "source": [
    "我其实仔细的思考了一下这个问题，这里面靠前的成绩大小和靠后成绩的数量对甲乙丙三人最后获胜的概率大小影响非常的大。\n",
    "\n",
    "不过它还反映出了一个问题，就是**这种多人博弈的评判，不能分解为两两比较大小来进行判断。**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "78e4a341",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9b6f775",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5bb34b84",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "id": "bdb687a7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 4 \\sin{\\left(x + \\frac{\\pi}{6} \\right)} \\cos{\\left(x \\right)} \\tan{\\left(x \\right)} - \\sqrt{3}$"
      ],
      "text/plain": [
       "4*sin(x + pi/6)*cos(x)*tan(x) - sqrt(3)"
      ]
     },
     "execution_count": 132,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr=4*tan(x)*sin(pi/2-x)*cos(x-pi/3)-sqrt(3)\n",
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "id": "d17c4d34",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - 2 \\cos{\\left(2 x + \\frac{\\pi}{6} \\right)}$"
      ],
      "text/plain": [
       "-2*cos(2*x + pi/6)"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "trigsimp(expr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "id": "d5264798",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 150.79644737231$"
      ],
      "text/plain": [
       "150.796447372310"
      ]
     },
     "execution_count": 134,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "N(48*pi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "id": "d564ed6f",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.abc import d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "id": "06291d78",
   "metadata": {},
   "outputs": [],
   "source": [
    "a1,a2=symbols(\"a1,a2\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a83e398",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "id": "dd9b55bf",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{d^{2}}{2} + \\left(2 a_{1} - d \\left(\\frac{\\sqrt{2}}{2} + 1\\right)\\right)^{2} = 4 c^{2}$"
      ],
      "text/plain": [
       "Eq(d**2/2 + (2*a1 - d*(sqrt(2)/2 + 1))**2, 4*c**2)"
      ]
     },
     "execution_count": 146,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eq1=Eq((2*a1-(1+1/sqrt(2))*d)**2+(d/sqrt(2))**2,(2*c)**2)\n",
    "eq1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "id": "c202ab5c",
   "metadata": {},
   "outputs": [],
   "source": [
    "expr=(eq1.subs(d,a1-a2)).lhs-(eq1.subs(d,a1-a2)).rhs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "id": "a4515808",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - 4 c^{2} + \\frac{\\left(a_{1} - a_{2}\\right)^{2}}{2} + \\left(2 a_{1} - \\left(\\frac{\\sqrt{2}}{2} + 1\\right) \\left(a_{1} - a_{2}\\right)\\right)^{2}$"
      ],
      "text/plain": [
       "-4*c**2 + (a1 - a2)**2/2 + (2*a1 - (sqrt(2)/2 + 1)*(a1 - a2))**2"
      ]
     },
     "execution_count": 158,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "id": "f872290b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - \\frac{\\sqrt{2} a_{1}^{2}}{c^{2}} + \\frac{2 a_{1}^{2}}{c^{2}} + \\frac{\\sqrt{2} a_{2}^{2}}{c^{2}} + \\frac{2 a_{2}^{2}}{c^{2}} - 4$"
      ],
      "text/plain": [
       "-sqrt(2)*a1**2/c**2 + 2*a1**2/c**2 + sqrt(2)*a2**2/c**2 + 2*a2**2/c**2 - 4"
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expand(expr/c**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "id": "1dae321a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle a_{1} - \\frac{\\sqrt{2} \\sqrt{- a_{1}^{2} + 2 \\sqrt{2} c^{2} + 4 c^{2}}}{\\sqrt{2} + 2}$"
      ],
      "text/plain": [
       "a1 - sqrt(2)*sqrt(-a1**2 + 2*sqrt(2)*c**2 + 4*c**2)/(sqrt(2) + 2)"
      ]
     },
     "execution_count": 147,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(solveset(eq1,d,Reals).args[1])[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "id": "1d509c49",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{d^{2}}{2} + \\left(2 a_{2} - \\frac{\\sqrt{2} d}{2} + d\\right)^{2} = 4 c^{2}$"
      ],
      "text/plain": [
       "Eq(d**2/2 + (2*a2 - sqrt(2)*d/2 + d)**2, 4*c**2)"
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eq2=Eq((d+2*a2-d/sqrt(2))**2+(d/sqrt(2))**2,(2*c)**2)\n",
    "eq2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "id": "6e23d1c4",
   "metadata": {},
   "outputs": [],
   "source": [
    "expr=(eq2.subs(d,a1-a2)).lhs-(eq2.subs(d,a1-a2)).rhs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "9f97fd60",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - 4 c^{2} + \\frac{\\left(a_{1} - a_{2}\\right)^{2}}{2} + \\left(a_{1} + a_{2} - \\frac{\\sqrt{2} \\left(a_{1} - a_{2}\\right)}{2}\\right)^{2}$"
      ],
      "text/plain": [
       "-4*c**2 + (a1 - a2)**2/2 + (a1 + a2 - sqrt(2)*(a1 - a2)/2)**2"
      ]
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 166,
   "id": "8d944a6d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - \\frac{\\sqrt{2} a_{1}^{2}}{c^{2}} + \\frac{2 a_{1}^{2}}{c^{2}} + \\frac{\\sqrt{2} a_{2}^{2}}{c^{2}} + \\frac{2 a_{2}^{2}}{c^{2}} - 4$"
      ],
      "text/plain": [
       "-sqrt(2)*a1**2/c**2 + 2*a1**2/c**2 + sqrt(2)*a2**2/c**2 + 2*a2**2/c**2 - 4"
      ]
     },
     "execution_count": 166,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expand(expr/c**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "id": "52e080d4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle - a_{2} + \\frac{\\sqrt{2} \\sqrt{- a_{2}^{2} - 2 \\sqrt{2} c^{2} + 4 c^{2}}}{2 - \\sqrt{2}}$"
      ],
      "text/plain": [
       "-a2 + sqrt(2)*sqrt(-a2**2 - 2*sqrt(2)*c**2 + 4*c**2)/(2 - sqrt(2))"
      ]
     },
     "execution_count": 151,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list(solveset(eq2,d,Reals).args[1])[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "id": "9484fdcc",
   "metadata": {},
   "outputs": [],
   "source": [
    "eq3=Eq(list(solveset(eq1,d,Reals).args[1])[1],list(solveset(eq2,d,Reals).args[1])[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 155,
   "id": "cfecd19e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle a_{1} - \\frac{\\sqrt{2} \\sqrt{- a_{1}^{2} + 2 \\sqrt{2} c^{2} + 4 c^{2}}}{\\sqrt{2} + 2} = - a_{2} + \\frac{\\sqrt{2} \\sqrt{- a_{2}^{2} - 2 \\sqrt{2} c^{2} + 4 c^{2}}}{2 - \\sqrt{2}}$"
      ],
      "text/plain": [
       "Eq(a1 - sqrt(2)*sqrt(-a1**2 + 2*sqrt(2)*c**2 + 4*c**2)/(sqrt(2) + 2), -a2 + sqrt(2)*sqrt(-a2**2 - 2*sqrt(2)*c**2 + 4*c**2)/(2 - sqrt(2)))"
      ]
     },
     "execution_count": 155,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "eq3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 154,
   "id": "1f765e51",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle a_{1} - \\sqrt{- 2 a_{1}^{2} + 4 \\sqrt{2} c^{2} + 8 c^{2}} + \\frac{\\sqrt{2} \\sqrt{- 2 a_{1}^{2} + 4 \\sqrt{2} c^{2} + 8 c^{2}}}{2} = - a_{2} + \\frac{\\sqrt{2} \\sqrt{- 2 a_{2}^{2} - 4 \\sqrt{2} c^{2} + 8 c^{2}}}{2} + \\sqrt{- 2 a_{2}^{2} - 4 \\sqrt{2} c^{2} + 8 c^{2}}$"
      ],
      "text/plain": [
       "Eq(a1 - sqrt(-2*a1**2 + 4*sqrt(2)*c**2 + 8*c**2) + sqrt(2)*sqrt(-2*a1**2 + 4*sqrt(2)*c**2 + 8*c**2)/2, -a2 + sqrt(2)*sqrt(-2*a2**2 - 4*sqrt(2)*c**2 + 8*c**2)/2 + sqrt(-2*a2**2 - 4*sqrt(2)*c**2 + 8*c**2))"
      ]
     },
     "execution_count": 154,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "simplify(eq3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "id": "ebba0a27",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.abc import m,n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 176,
   "id": "ca6d964b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\operatorname{FiniteDistributionHandmade}\\left(\\left\\{ 1 : \\frac{1}{3}, \\  2 : m, \\  3 : n\\right\\}\\right)$"
      ],
      "text/plain": [
       "FiniteDistributionHandmade({1: 1/3, 2: m, 3: n})"
      ]
     },
     "execution_count": 176,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X=FiniteRV(\"X\",{1:Rational(1,3),2:m,3:n})\n",
    "density(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 178,
   "id": "2690764e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left\\{\\left( \\frac{1}{3}, \\  \\frac{1}{3}\\right)\\right\\}$"
      ],
      "text/plain": [
       "{(1/3, 1/3)}"
      ]
     },
     "execution_count": 178,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "linsolve([E(X)-2,m+n-Rational(2,3)],[m,n])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 181,
   "id": "151ec7fb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle m \\left(- 2 m - 3 n + \\frac{5}{3}\\right)^{2} + n \\left(- 2 m - 3 n + \\frac{8}{3}\\right)^{2} + \\frac{\\left(- 2 m - 3 n + \\frac{2}{3}\\right)^{2}}{3}$"
      ],
      "text/plain": [
       "m*(-2*m - 3*n + 5/3)**2 + n*(-2*m - 3*n + 8/3)**2 + (-2*m - 3*n + 2/3)**2/3"
      ]
     },
     "execution_count": 181,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "variance(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "id": "de365ac2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{2}{3}$"
      ],
      "text/plain": [
       "2/3"
      ]
     },
     "execution_count": 180,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "variance(X).subs([(n,Rational(1,3)),(m,Rational(1,3))])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "id": "b847f056",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[124, 126, 132, 128, 130]"
      ]
     },
     "execution_count": 195,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a=[124,126,132,128,130]\n",
    "data_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "id": "2c3fcfc0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[121, 128, 135, 133, 123]"
      ]
     },
     "execution_count": 196,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b=[121,128,135,133,123]\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "id": "c71bb073",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "128.0"
      ]
     },
     "execution_count": 197,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_a)/len(data_a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "id": "6d7c5a3e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "128.0"
      ]
     },
     "execution_count": 198,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_b)/len(data_b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "id": "3abc428d",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}-4 & 0 & 0 & 0 & 0\\\\0 & -2 & 0 & 0 & 0\\\\0 & 0 & 4 & 0 & 0\\\\0 & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 2\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[-4,  0, 0, 0, 0],\n",
       "[ 0, -2, 0, 0, 0],\n",
       "[ 0,  0, 4, 0, 0],\n",
       "[ 0,  0, 0, 0, 0],\n",
       "[ 0,  0, 0, 0, 2]])"
      ]
     },
     "execution_count": 200,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diag(*data_a)-diag(*([128]*len(data_a)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "id": "b7d8037d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 40$"
      ],
      "text/plain": [
       "40"
      ]
     },
     "execution_count": 202,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum((diag(*data_a)-diag(*([128]*len(data_a))))**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "id": "d493da35",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 148$"
      ],
      "text/plain": [
       "148"
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum((diag(*data_b)-diag(*([128]*len(data_b))))**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "id": "b8d0d811",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[97, 90, x, 95, 92, 85, 87, 90, 94]"
      ]
     },
     "execution_count": 204,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_x=[97,90,x,95,92,85,87,90,94]\n",
    "data_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "id": "2cfbeab3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 206,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data_x)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 211,
   "id": "5ff87cdf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 645$"
      ],
      "text/plain": [
       "645"
      ]
     },
     "execution_count": 211,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(sum(data_x)-x-85)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 212,
   "id": "e062e331",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle x + 548$"
      ],
      "text/plain": [
       "x + 548"
      ]
     },
     "execution_count": 212,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_x)-85-97"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "id": "310e39d3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left\\{89\\right\\}$"
      ],
      "text/plain": [
       "{89}"
      ]
     },
     "execution_count": 209,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solveset((sum(data_x)-85-97)/(len(data_x)-2)-91,x,Reals)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 247,
   "id": "a438c415",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[80, 83, 138, 155, 157, 165, 179, 214, 214, 221, 243, 260, 263, 275]"
      ]
     },
     "execution_count": 247,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a=[214,275,243,157,80,155,260,83,165,179,138,214,221,263]\n",
    "data_o=data_a.copy()\n",
    "data_a.sort()\n",
    "data_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 248,
   "id": "83b61dd8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[214, 275, 243, 157, 80, 155, 260, 83, 165, 179, 138, 214, 221, 263]"
      ]
     },
     "execution_count": 248,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_o"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "id": "1297905b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14"
      ]
     },
     "execution_count": 236,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(data_a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "id": "290f941f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "196.5"
      ]
     },
     "execution_count": 237,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(data_a[6]+data_a[7])/2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 244,
   "id": "97db77ad",
   "metadata": {},
   "outputs": [],
   "source": [
    "def mean(data):\n",
    "    return sum(data)/len(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 238,
   "id": "d54a7596",
   "metadata": {},
   "outputs": [],
   "source": [
    "def _variance(data ,stats=True):\n",
    "    length=len(data)\n",
    "    mean=sum(data)/length\n",
    "    variance=0\n",
    "    for i in range(length):\n",
    "        variance+=(data[i]-mean)**2\n",
    "    if (stats):\n",
    "        return variance/(length-1)\n",
    "    else:\n",
    "        return variance/length\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 249,
   "id": "9ca612e2",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[214, 275, 243, 157, 80, 155, 260]"
      ]
     },
     "execution_count": 249,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b=data_o[0:7]\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 250,
   "id": "342ae610",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "197.71428571428572"
      ]
     },
     "execution_count": 250,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean(data_b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 256,
   "id": "5f1d5c8a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{1384}{7}$"
      ],
      "text/plain": [
       "1384/7"
      ]
     },
     "execution_count": 256,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rational(mean(data_b)).limit_denominator(200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 251,
   "id": "11bcfd17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4917.9047619047615"
      ]
     },
     "execution_count": 251,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_variance(data_b)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 252,
   "id": "58d00d31",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[83, 165, 179, 138, 214, 221, 263]"
      ]
     },
     "execution_count": 252,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_c=data_o[-7::]\n",
    "data_c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 253,
   "id": "3965ec68",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "180.42857142857142"
      ]
     },
     "execution_count": 253,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mean(data_c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 257,
   "id": "a969ae01",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{1263}{7}$"
      ],
      "text/plain": [
       "1263/7"
      ]
     },
     "execution_count": 257,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rational(mean(data_c)).limit_denominator(200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 254,
   "id": "d0fb7ab8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3520.6190476190477"
      ]
     },
     "execution_count": 254,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "_variance(data_c)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 243,
   "id": "2a703916",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "195"
      ]
     },
     "execution_count": 243,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a[-1]-data_a[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "cd3a90fb",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 258,
   "id": "f4d8b10b",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_i=[40,50,60,70,80,90,100]\n",
    "data_p=[0.05,0.15,0.2,0.3,0.25,0.05]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 259,
   "id": "02371f08",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "72.0\n"
     ]
    }
   ],
   "source": [
    "sums=0\n",
    "for i in range(len(data_p)):\n",
    "    sums+=data_p[i]*(data_i[i]+data_i[i+1])/2\n",
    "print(sums)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 263,
   "id": "9103b1a2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function trace in module sympy.matrices.expressions.trace:\n",
      "\n",
      "trace(expr)\n",
      "    Trace of a Matrix.  Sum of the diagonal elements.\n",
      "    \n",
      "    Examples\n",
      "    ========\n",
      "    \n",
      "    >>> from sympy import trace, Symbol, MatrixSymbol, eye\n",
      "    >>> n = Symbol('n')\n",
      "    >>> X = MatrixSymbol('X', n, n)  # A square matrix\n",
      "    >>> trace(2*X)\n",
      "    2*Trace(X)\n",
      "    >>> trace(eye(3))\n",
      "    3\n",
      "\n"
     ]
    }
   ],
   "source": [
    "\n",
    "help(trace)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 266,
   "id": "0c5243ce",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 2 & 0\\\\0 & 0 & 3\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[1, 0, 0],\n",
       "[0, 2, 0],\n",
       "[0, 0, 3]])"
      ]
     },
     "execution_count": 266,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diag((diag(*[1,2,3])))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 267,
   "id": "00b61832",
   "metadata": {},
   "outputs": [],
   "source": [
    "data_x=[4,6,7,8,10]\n",
    "data_z=[2,3,4,5,6]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 291,
   "id": "e5c76a8a",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on class Data in module excel_function_package.data:\n",
      "\n",
      "class Data(builtins.list, typing.Generic)\n",
      " |  Data(iterable=(), /)\n",
      " |  \n",
      " |  this is a child class of list.\n",
      " |  \n",
      " |  Method resolution order:\n",
      " |      Data\n",
      " |      builtins.list\n",
      " |      typing.Generic\n",
      " |      builtins.object\n",
      " |  \n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  mean(self)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors defined here:\n",
      " |  \n",
      " |  __dict__\n",
      " |      dictionary for instance variables (if defined)\n",
      " |  \n",
      " |  __weakref__\n",
      " |      list of weak references to the object (if defined)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from builtins.list:\n",
      " |  \n",
      " |  __add__(self, value, /)\n",
      " |      Return self+value.\n",
      " |  \n",
      " |  __contains__(self, key, /)\n",
      " |      Return key in self.\n",
      " |  \n",
      " |  __delitem__(self, key, /)\n",
      " |      Delete self[key].\n",
      " |  \n",
      " |  __eq__(self, value, /)\n",
      " |      Return self==value.\n",
      " |  \n",
      " |  __ge__(self, value, /)\n",
      " |      Return self>=value.\n",
      " |  \n",
      " |  __getattribute__(self, name, /)\n",
      " |      Return getattr(self, name).\n",
      " |  \n",
      " |  __getitem__(...)\n",
      " |      x.__getitem__(y) <==> x[y]\n",
      " |  \n",
      " |  __gt__(self, value, /)\n",
      " |      Return self>value.\n",
      " |  \n",
      " |  __iadd__(self, value, /)\n",
      " |      Implement self+=value.\n",
      " |  \n",
      " |  __imul__(self, value, /)\n",
      " |      Implement self*=value.\n",
      " |  \n",
      " |  __init__(self, /, *args, **kwargs)\n",
      " |      Initialize self.  See help(type(self)) for accurate signature.\n",
      " |  \n",
      " |  __iter__(self, /)\n",
      " |      Implement iter(self).\n",
      " |  \n",
      " |  __le__(self, value, /)\n",
      " |      Return self<=value.\n",
      " |  \n",
      " |  __len__(self, /)\n",
      " |      Return len(self).\n",
      " |  \n",
      " |  __lt__(self, value, /)\n",
      " |      Return self<value.\n",
      " |  \n",
      " |  __mul__(self, value, /)\n",
      " |      Return self*value.\n",
      " |  \n",
      " |  __ne__(self, value, /)\n",
      " |      Return self!=value.\n",
      " |  \n",
      " |  __repr__(self, /)\n",
      " |      Return repr(self).\n",
      " |  \n",
      " |  __reversed__(self, /)\n",
      " |      Return a reverse iterator over the list.\n",
      " |  \n",
      " |  __rmul__(self, value, /)\n",
      " |      Return value*self.\n",
      " |  \n",
      " |  __setitem__(self, key, value, /)\n",
      " |      Set self[key] to value.\n",
      " |  \n",
      " |  __sizeof__(self, /)\n",
      " |      Return the size of the list in memory, in bytes.\n",
      " |  \n",
      " |  append(self, object, /)\n",
      " |      Append object to the end of the list.\n",
      " |  \n",
      " |  clear(self, /)\n",
      " |      Remove all items from list.\n",
      " |  \n",
      " |  copy(self, /)\n",
      " |      Return a shallow copy of the list.\n",
      " |  \n",
      " |  count(self, value, /)\n",
      " |      Return number of occurrences of value.\n",
      " |  \n",
      " |  extend(self, iterable, /)\n",
      " |      Extend list by appending elements from the iterable.\n",
      " |  \n",
      " |  index(self, value, start=0, stop=9223372036854775807, /)\n",
      " |      Return first index of value.\n",
      " |      \n",
      " |      Raises ValueError if the value is not present.\n",
      " |  \n",
      " |  insert(self, index, object, /)\n",
      " |      Insert object before index.\n",
      " |  \n",
      " |  pop(self, index=-1, /)\n",
      " |      Remove and return item at index (default last).\n",
      " |      \n",
      " |      Raises IndexError if list is empty or index is out of range.\n",
      " |  \n",
      " |  remove(self, value, /)\n",
      " |      Remove first occurrence of value.\n",
      " |      \n",
      " |      Raises ValueError if the value is not present.\n",
      " |  \n",
      " |  reverse(self, /)\n",
      " |      Reverse *IN PLACE*.\n",
      " |  \n",
      " |  sort(self, /, *, key=None, reverse=False)\n",
      " |      Sort the list in ascending order and return None.\n",
      " |      \n",
      " |      The sort is in-place (i.e. the list itself is modified) and stable (i.e. the\n",
      " |      order of two equal elements is maintained).\n",
      " |      \n",
      " |      If a key function is given, apply it once to each list item and sort them,\n",
      " |      ascending or descending, according to their function values.\n",
      " |      \n",
      " |      The reverse flag can be set to sort in descending order.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from builtins.list:\n",
      " |  \n",
      " |  __class_getitem__(...) from builtins.type\n",
      " |      See PEP 585\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods inherited from builtins.list:\n",
      " |  \n",
      " |  __new__(*args, **kwargs) from builtins.type\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from builtins.list:\n",
      " |  \n",
      " |  __hash__ = None\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from typing.Generic:\n",
      " |  \n",
      " |  __init_subclass__(*args, **kwargs) from builtins.type\n",
      " |      This method is called when a class is subclassed.\n",
      " |      \n",
      " |      The default implementation does nothing. It may be\n",
      " |      overridden to extend subclasses.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(Data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 293,
   "id": "2fec0399",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7.0"
      ]
     },
     "execution_count": 293,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Data(data_x).mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 305,
   "id": "a55a537b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function trace in module sympy.matrices.expressions.trace:\n",
      "\n",
      "trace(expr)\n",
      "    Trace of a Matrix.  Sum of the diagonal elements.\n",
      "    \n",
      "    Examples\n",
      "    ========\n",
      "    \n",
      "    >>> from sympy import trace, Symbol, MatrixSymbol, eye\n",
      "    >>> n = Symbol('n')\n",
      "    >>> X = MatrixSymbol('X', n, n)  # A square matrix\n",
      "    >>> trace(2*X)\n",
      "    2*Trace(X)\n",
      "    >>> trace(eye(3))\n",
      "    3\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(trace)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 304,
   "id": "1cf8a301",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 2 & 0\\\\0 & 0 & 3\\end{matrix}\\right]$"
      ],
      "text/plain": [
       "Matrix([\n",
       "[1, 0, 0],\n",
       "[0, 2, 0],\n",
       "[0, 0, 3]])"
      ]
     },
     "execution_count": 304,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diag(diag(*[1,2,3]),unpack=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b2d8df6e",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 276,
   "id": "b02e722b",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle x^{4} - 14 x^{3} + 84 x^{2} - 280 x + 560 - \\frac{672}{x} + \\frac{448}{x^{2}} - \\frac{128}{x^{3}}$"
      ],
      "text/plain": [
       "x**4 - 14*x**3 + 84*x**2 - 280*x + 560 - 672/x + 448/x**2 - 128/x**3"
      ]
     },
     "execution_count": 276,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expand((x-2)*(sqrt(x)-2/sqrt(x))**6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 306,
   "id": "11b9c965",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[0.04, 10*a, 0.22, 0.28, 0.22, 0.18]"
      ]
     },
     "execution_count": 306,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_a=Data([0.04,10*a,0.22,0.28,0.22,0.18])\n",
    "data_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 307,
   "id": "83959eb7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\left\\{0.00600000000000001\\right\\}$"
      ],
      "text/plain": [
       "{0.00600000000000001}"
      ]
     },
     "execution_count": 307,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "solveset(sum(data_a)-1,a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 308,
   "id": "52420a17",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[40, 50, 60, 70, 80, 90, 100]"
      ]
     },
     "execution_count": 308,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_b=Data([40,50,60,70,80,90,100])\n",
    "data_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 311,
   "id": "864f6804",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "550*a + 72.9\n"
     ]
    }
   ],
   "source": [
    "sums=0\n",
    "for i in range(len(data_a)):\n",
    "    sums+=data_a[i]*(data_b[i]+data_b[i+1])/2\n",
    "print(sums)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 313,
   "id": "96817657",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 76.2$"
      ],
      "text/plain": [
       "76.2000000000000"
      ]
     },
     "execution_count": 313,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(550*a + 72.9).subs(a,0.006)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 315,
   "id": "0ccade3b",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method diagonalize in module sympy.matrices.matrices:\n",
      "\n",
      "diagonalize(reals_only=False, sort=False, normalize=False) method of sympy.matrices.dense.MutableDenseMatrix instance\n",
      "    Return (P, D), where D is diagonal and\n",
      "    \n",
      "        D = P^-1 * M * P\n",
      "    \n",
      "    where M is current matrix.\n",
      "    \n",
      "    Parameters\n",
      "    ==========\n",
      "    \n",
      "    reals_only : bool. Whether to throw an error if complex numbers are need\n",
      "                    to diagonalize. (Default: False)\n",
      "    \n",
      "    sort : bool. Sort the eigenvalues along the diagonal. (Default: False)\n",
      "    \n",
      "    normalize : bool. If True, normalize the columns of P. (Default: False)\n",
      "    \n",
      "    Examples\n",
      "    ========\n",
      "    \n",
      "    >>> from sympy import Matrix\n",
      "    >>> M = Matrix(3, 3, [1, 2, 0, 0, 3, 0, 2, -4, 2])\n",
      "    >>> M\n",
      "    Matrix([\n",
      "    [1,  2, 0],\n",
      "    [0,  3, 0],\n",
      "    [2, -4, 2]])\n",
      "    >>> (P, D) = M.diagonalize()\n",
      "    >>> D\n",
      "    Matrix([\n",
      "    [1, 0, 0],\n",
      "    [0, 2, 0],\n",
      "    [0, 0, 3]])\n",
      "    >>> P\n",
      "    Matrix([\n",
      "    [-1, 0, -1],\n",
      "    [ 0, 0, -1],\n",
      "    [ 2, 1,  2]])\n",
      "    >>> P.inv() * M * P\n",
      "    Matrix([\n",
      "    [1, 0, 0],\n",
      "    [0, 2, 0],\n",
      "    [0, 0, 3]])\n",
      "    \n",
      "    See Also\n",
      "    ========\n",
      "    \n",
      "    is_diagonal\n",
      "    is_diagonalizable\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(Matrix().diagonalize)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 331,
   "id": "a26b36f7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 331,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type([1,2])==list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 340,
   "id": "225f7430",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 340,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(data_a)==excel_function_package.data.Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 320,
   "id": "8ecf915d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 2$"
      ],
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 320,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Data(ones(1,3)*diag(*[1,2,3])).variance()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 335,
   "id": "f50034fa",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[37, 38, 39, 40]"
      ]
     },
     "execution_count": 335,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_x=Data([37,38,39,40])\n",
    "data_x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 336,
   "id": "6e183261",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[1, 2, 4, 5]"
      ]
     },
     "execution_count": 336,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_y=Data([1,2,4,5])\n",
    "data_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 338,
   "id": "3ac3f774",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 5934$"
      ],
      "text/plain": [
       "5934"
      ]
     },
     "execution_count": 338,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_x.power(2,central=False))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 345,
   "id": "bdd6bb0a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "469"
      ]
     },
     "execution_count": 345,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_x*data_y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 346,
   "id": "d177bf60",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 1.4$"
      ],
      "text/plain": [
       "1.40000000000000"
      ]
     },
     "execution_count": 346,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(data_x.power(1)*data_y.power(1))/sum(data_x.power(2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 347,
   "id": "e1da93ec",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-50.9"
      ]
     },
     "execution_count": 347,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "3-1.4*38.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 350,
   "id": "5743f562",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4, 6, 5, 4, 6, 4, 2]"
      ]
     },
     "execution_count": 350,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_days=Data([4,6,5,4,6,4,2])\n",
    "data_days"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 392,
   "id": "4ab392cd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[-1, 0, 1/2, 1, 2, 3, 4]"
      ]
     },
     "execution_count": 392,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_profits=Data([-1,0,Rational(1,2),1,2,3,4])\n",
    "data_profits"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 393,
   "id": "91e73322",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{-1: 4/31, 0: 6/31, 1/2: 5/31, 1: 4/31, 2: 6/31, 3: 4/31, 4: 2/31}"
      ]
     },
     "execution_count": 393,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pdf=dict(zip((data_profits),(data_days*Rational(1,31))))\n",
    "pdf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 394,
   "id": "fb4e21f3",
   "metadata": {},
   "outputs": [],
   "source": [
    "X=FiniteRV(\"X\",pdf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 397,
   "id": "6e192137",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{69}{62}$"
      ],
      "text/plain": [
       "69/62"
      ]
     },
     "execution_count": 397,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(E(X))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 396,
   "id": "4782b3c7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 1.11290322580645$"
      ],
      "text/plain": [
       "1.11290322580645"
      ]
     },
     "execution_count": 396,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "N(E(X))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 400,
   "id": "98fbede4",
   "metadata": {},
   "outputs": [],
   "source": [
    "f=Function(\"f\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 402,
   "id": "368901d2",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on class Function in module sympy.core.function:\n",
      "\n",
      "class Function(Application, sympy.core.expr.Expr)\n",
      " |  Function(*args)\n",
      " |  \n",
      " |  Base class for applied mathematical functions.\n",
      " |  \n",
      " |  It also serves as a constructor for undefined function classes.\n",
      " |  \n",
      " |  See the :ref:`custom-functions` guide for details on how to subclass\n",
      " |  ``Function`` and what methods can be defined.\n",
      " |  \n",
      " |  Examples\n",
      " |  ========\n",
      " |  \n",
      " |  **Undefined Functions**\n",
      " |  \n",
      " |  To create an undefined function, pass a string of the function name to\n",
      " |  ``Function``.\n",
      " |  \n",
      " |  >>> from sympy import Function, Symbol\n",
      " |  >>> x = Symbol('x')\n",
      " |  >>> f = Function('f')\n",
      " |  >>> g = Function('g')(x)\n",
      " |  >>> f\n",
      " |  f\n",
      " |  >>> f(x)\n",
      " |  f(x)\n",
      " |  >>> g\n",
      " |  g(x)\n",
      " |  >>> f(x).diff(x)\n",
      " |  Derivative(f(x), x)\n",
      " |  >>> g.diff(x)\n",
      " |  Derivative(g(x), x)\n",
      " |  \n",
      " |  Assumptions can be passed to ``Function`` the same as with a\n",
      " |  :class:`~.Symbol`. Alternatively, you can use a ``Symbol`` with\n",
      " |  assumptions for the function name and the function will inherit the name\n",
      " |  and assumptions associated with the ``Symbol``:\n",
      " |  \n",
      " |  >>> f_real = Function('f', real=True)\n",
      " |  >>> f_real(x).is_real\n",
      " |  True\n",
      " |  >>> f_real_inherit = Function(Symbol('f', real=True))\n",
      " |  >>> f_real_inherit(x).is_real\n",
      " |  True\n",
      " |  \n",
      " |  Note that assumptions on a function are unrelated to the assumptions on\n",
      " |  the variables it is called on. If you want to add a relationship, subclass\n",
      " |  ``Function`` and define custom assumptions handler methods. See the\n",
      " |  :ref:`custom-functions-assumptions` section of the :ref:`custom-functions`\n",
      " |  guide for more details.\n",
      " |  \n",
      " |  **Custom Function Subclasses**\n",
      " |  \n",
      " |  The :ref:`custom-functions` guide has several\n",
      " |  :ref:`custom-functions-complete-examples` of how to subclass ``Function``\n",
      " |  to create a custom function.\n",
      " |  \n",
      " |  Method resolution order:\n",
      " |      Function\n",
      " |      Application\n",
      " |      sympy.core.expr.Expr\n",
      " |      sympy.core.basic.Basic\n",
      " |      sympy.printing.defaults.Printable\n",
      " |      sympy.core.evalf.EvalfMixin\n",
      " |      builtins.object\n",
      " |  \n",
      " |  Methods defined here:\n",
      " |  \n",
      " |  as_base_exp(self)\n",
      " |      Returns the method as the 2-tuple (base, exponent).\n",
      " |  \n",
      " |  fdiff(self, argindex=1)\n",
      " |      Returns the first derivative of the function.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods defined here:\n",
      " |  \n",
      " |  class_key() from sympy.core.function.FunctionClass\n",
      " |      Nice order of classes.\n",
      " |  \n",
      " |  is_singular(a) from sympy.core.function.FunctionClass\n",
      " |      Tests whether the argument is an essential singularity\n",
      " |      or a branch point, or the functions is non-holomorphic.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods defined here:\n",
      " |  \n",
      " |  __new__(cls, *args, **options)\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Readonly properties defined here:\n",
      " |  \n",
      " |  __sympy__\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes defined here:\n",
      " |  \n",
      " |  default_assumptions = {}\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from Application:\n",
      " |  \n",
      " |  eval(*args) from sympy.core.function.FunctionClass\n",
      " |      Returns a canonical form of cls applied to arguments args.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      The eval() method is called when the class cls is about to be\n",
      " |      instantiated and it should return either some simplified instance\n",
      " |      (possible of some other class), or if the class cls should be\n",
      " |      unmodified, return None.\n",
      " |      \n",
      " |      Examples of eval() for the function \"sign\"\n",
      " |      ---------------------------------------------\n",
      " |      \n",
      " |      .. code-block:: python\n",
      " |      \n",
      " |          @classmethod\n",
      " |          def eval(cls, arg):\n",
      " |              if arg is S.NaN:\n",
      " |                  return S.NaN\n",
      " |              if arg.is_zero: return S.Zero\n",
      " |              if arg.is_positive: return S.One\n",
      " |              if arg.is_negative: return S.NegativeOne\n",
      " |              if isinstance(arg, Mul):\n",
      " |                  coeff, terms = arg.as_coeff_Mul(rational=True)\n",
      " |                  if coeff is not S.One:\n",
      " |                      return cls(coeff) * cls(terms)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Readonly properties inherited from Application:\n",
      " |  \n",
      " |  func\n",
      " |      The top-level function in an expression.\n",
      " |      \n",
      " |      The following should hold for all objects::\n",
      " |      \n",
      " |          >> x == x.func(*x.args)\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> a = 2*x\n",
      " |      >>> a.func\n",
      " |      <class 'sympy.core.mul.Mul'>\n",
      " |      >>> a.args\n",
      " |      (2, x)\n",
      " |      >>> a.func(*a.args)\n",
      " |      2*x\n",
      " |      >>> a == a.func(*a.args)\n",
      " |      True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors inherited from Application:\n",
      " |  \n",
      " |  __dict__\n",
      " |      dictionary for instance variables (if defined)\n",
      " |  \n",
      " |  __weakref__\n",
      " |      list of weak references to the object (if defined)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from Application:\n",
      " |  \n",
      " |  is_Function = True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.expr.Expr:\n",
      " |  \n",
      " |  __abs__(self) -> 'Expr'\n",
      " |  \n",
      " |  __add__(self, other)\n",
      " |  \n",
      " |  __complex__(self)\n",
      " |  \n",
      " |  __divmod__(self, other)\n",
      " |  \n",
      " |  __float__(self)\n",
      " |  \n",
      " |  __floordiv__(self, other)\n",
      " |  \n",
      " |  __format__(self, format_spec: 'str')\n",
      " |      Default object formatter.\n",
      " |  \n",
      " |  __ge__(self, other)\n",
      " |      Return self>=value.\n",
      " |  \n",
      " |  __gt__(self, other)\n",
      " |      Return self>value.\n",
      " |  \n",
      " |  __int__(self)\n",
      " |  \n",
      " |  __le__(self, other)\n",
      " |      Return self<=value.\n",
      " |  \n",
      " |  __lt__(self, other)\n",
      " |      Return self<value.\n",
      " |  \n",
      " |  __mod__(self, other)\n",
      " |  \n",
      " |  __mul__(self, other)\n",
      " |  \n",
      " |  __neg__(self)\n",
      " |  \n",
      " |  __pos__(self)\n",
      " |  \n",
      " |  __pow__(self, other, mod=None) -> 'Expr'\n",
      " |  \n",
      " |  __radd__(self, other)\n",
      " |  \n",
      " |  __rdivmod__(self, other)\n",
      " |  \n",
      " |  __rfloordiv__(self, other)\n",
      " |  \n",
      " |  __rmod__(self, other)\n",
      " |  \n",
      " |  __rmul__(self, other)\n",
      " |  \n",
      " |  __round__ = round(self, n=None)\n",
      " |  \n",
      " |  __rpow__(self, other)\n",
      " |  \n",
      " |  __rsub__(self, other)\n",
      " |  \n",
      " |  __rtruediv__(self, other)\n",
      " |  \n",
      " |  __sub__(self, other)\n",
      " |  \n",
      " |  __truediv__(self, other)\n",
      " |  \n",
      " |  __trunc__(self)\n",
      " |  \n",
      " |  adjoint(self)\n",
      " |  \n",
      " |  apart(self, x=None, **args)\n",
      " |      See the apart function in sympy.polys\n",
      " |  \n",
      " |  args_cnc(self, cset=False, warn=True, split_1=True)\n",
      " |      Return [commutative factors, non-commutative factors] of self.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      self is treated as a Mul and the ordering of the factors is maintained.\n",
      " |      If ``cset`` is True the commutative factors will be returned in a set.\n",
      " |      If there were repeated factors (as may happen with an unevaluated Mul)\n",
      " |      then an error will be raised unless it is explicitly suppressed by\n",
      " |      setting ``warn`` to False.\n",
      " |      \n",
      " |      Note: -1 is always separated from a Number unless split_1 is False.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols, oo\n",
      " |      >>> A, B = symbols('A B', commutative=0)\n",
      " |      >>> x, y = symbols('x y')\n",
      " |      >>> (-2*x*y).args_cnc()\n",
      " |      [[-1, 2, x, y], []]\n",
      " |      >>> (-2.5*x).args_cnc()\n",
      " |      [[-1, 2.5, x], []]\n",
      " |      >>> (-2*x*A*B*y).args_cnc()\n",
      " |      [[-1, 2, x, y], [A, B]]\n",
      " |      >>> (-2*x*A*B*y).args_cnc(split_1=False)\n",
      " |      [[-2, x, y], [A, B]]\n",
      " |      >>> (-2*x*y).args_cnc(cset=True)\n",
      " |      [{-1, 2, x, y}, []]\n",
      " |      \n",
      " |      The arg is always treated as a Mul:\n",
      " |      \n",
      " |      >>> (-2 + x + A).args_cnc()\n",
      " |      [[], [x - 2 + A]]\n",
      " |      >>> (-oo).args_cnc() # -oo is a singleton\n",
      " |      [[-1, oo], []]\n",
      " |  \n",
      " |  as_coeff_Add(self, rational=False) -> \"tuple['Number', Expr]\"\n",
      " |      Efficiently extract the coefficient of a summation.\n",
      " |  \n",
      " |  as_coeff_Mul(self, rational: 'bool' = False) -> \"tuple['Number', Expr]\"\n",
      " |      Efficiently extract the coefficient of a product.\n",
      " |  \n",
      " |  as_coeff_add(self, *deps) -> 'tuple[Expr, tuple[Expr, ...]]'\n",
      " |      Return the tuple (c, args) where self is written as an Add, ``a``.\n",
      " |      \n",
      " |      c should be a Rational added to any terms of the Add that are\n",
      " |      independent of deps.\n",
      " |      \n",
      " |      args should be a tuple of all other terms of ``a``; args is empty\n",
      " |      if self is a Number or if self is independent of deps (when given).\n",
      " |      \n",
      " |      This should be used when you do not know if self is an Add or not but\n",
      " |      you want to treat self as an Add or if you want to process the\n",
      " |      individual arguments of the tail of self as an Add.\n",
      " |      \n",
      " |      - if you know self is an Add and want only the head, use self.args[0];\n",
      " |      - if you do not want to process the arguments of the tail but need the\n",
      " |        tail then use self.as_two_terms() which gives the head and tail.\n",
      " |      - if you want to split self into an independent and dependent parts\n",
      " |        use ``self.as_independent(*deps)``\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (S(3)).as_coeff_add()\n",
      " |      (3, ())\n",
      " |      >>> (3 + x).as_coeff_add()\n",
      " |      (3, (x,))\n",
      " |      >>> (3 + x + y).as_coeff_add(x)\n",
      " |      (y + 3, (x,))\n",
      " |      >>> (3 + y).as_coeff_add(x)\n",
      " |      (y + 3, ())\n",
      " |  \n",
      " |  as_coeff_exponent(self, x) -> 'tuple[Expr, Expr]'\n",
      " |      ``c*x**e -> c,e`` where x can be any symbolic expression.\n",
      " |  \n",
      " |  as_coeff_mul(self, *deps, **kwargs) -> 'tuple[Expr, tuple[Expr, ...]]'\n",
      " |      Return the tuple (c, args) where self is written as a Mul, ``m``.\n",
      " |      \n",
      " |      c should be a Rational multiplied by any factors of the Mul that are\n",
      " |      independent of deps.\n",
      " |      \n",
      " |      args should be a tuple of all other factors of m; args is empty\n",
      " |      if self is a Number or if self is independent of deps (when given).\n",
      " |      \n",
      " |      This should be used when you do not know if self is a Mul or not but\n",
      " |      you want to treat self as a Mul or if you want to process the\n",
      " |      individual arguments of the tail of self as a Mul.\n",
      " |      \n",
      " |      - if you know self is a Mul and want only the head, use self.args[0];\n",
      " |      - if you do not want to process the arguments of the tail but need the\n",
      " |        tail then use self.as_two_terms() which gives the head and tail;\n",
      " |      - if you want to split self into an independent and dependent parts\n",
      " |        use ``self.as_independent(*deps)``\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (S(3)).as_coeff_mul()\n",
      " |      (3, ())\n",
      " |      >>> (3*x*y).as_coeff_mul()\n",
      " |      (3, (x, y))\n",
      " |      >>> (3*x*y).as_coeff_mul(x)\n",
      " |      (3*y, (x,))\n",
      " |      >>> (3*y).as_coeff_mul(x)\n",
      " |      (3*y, ())\n",
      " |  \n",
      " |  as_coefficient(self, expr)\n",
      " |      Extracts symbolic coefficient at the given expression. In\n",
      " |      other words, this functions separates 'self' into the product\n",
      " |      of 'expr' and 'expr'-free coefficient. If such separation\n",
      " |      is not possible it will return None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import E, pi, sin, I, Poly\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> E.as_coefficient(E)\n",
      " |      1\n",
      " |      >>> (2*E).as_coefficient(E)\n",
      " |      2\n",
      " |      >>> (2*sin(E)*E).as_coefficient(E)\n",
      " |      \n",
      " |      Two terms have E in them so a sum is returned. (If one were\n",
      " |      desiring the coefficient of the term exactly matching E then\n",
      " |      the constant from the returned expression could be selected.\n",
      " |      Or, for greater precision, a method of Poly can be used to\n",
      " |      indicate the desired term from which the coefficient is\n",
      " |      desired.)\n",
      " |      \n",
      " |      >>> (2*E + x*E).as_coefficient(E)\n",
      " |      x + 2\n",
      " |      >>> _.args[0]  # just want the exact match\n",
      " |      2\n",
      " |      >>> p = Poly(2*E + x*E); p\n",
      " |      Poly(x*E + 2*E, x, E, domain='ZZ')\n",
      " |      >>> p.coeff_monomial(E)\n",
      " |      2\n",
      " |      >>> p.nth(0, 1)\n",
      " |      2\n",
      " |      \n",
      " |      Since the following cannot be written as a product containing\n",
      " |      E as a factor, None is returned. (If the coefficient ``2*x`` is\n",
      " |      desired then the ``coeff`` method should be used.)\n",
      " |      \n",
      " |      >>> (2*E*x + x).as_coefficient(E)\n",
      " |      >>> (2*E*x + x).coeff(E)\n",
      " |      2*x\n",
      " |      \n",
      " |      >>> (E*(x + 1) + x).as_coefficient(E)\n",
      " |      \n",
      " |      >>> (2*pi*I).as_coefficient(pi*I)\n",
      " |      2\n",
      " |      >>> (2*I).as_coefficient(pi*I)\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      coeff: return sum of terms have a given factor\n",
      " |      as_coeff_Add: separate the additive constant from an expression\n",
      " |      as_coeff_Mul: separate the multiplicative constant from an expression\n",
      " |      as_independent: separate x-dependent terms/factors from others\n",
      " |      sympy.polys.polytools.Poly.coeff_monomial: efficiently find the single coefficient of a monomial in Poly\n",
      " |      sympy.polys.polytools.Poly.nth: like coeff_monomial but powers of monomial terms are used\n",
      " |  \n",
      " |  as_coefficients_dict(self, *syms)\n",
      " |      Return a dictionary mapping terms to their Rational coefficient.\n",
      " |      Since the dictionary is a defaultdict, inquiries about terms which\n",
      " |      were not present will return a coefficient of 0.\n",
      " |      \n",
      " |      If symbols ``syms`` are provided, any multiplicative terms\n",
      " |      independent of them will be considered a coefficient and a\n",
      " |      regular dictionary of syms-dependent generators as keys and\n",
      " |      their corresponding coefficients as values will be returned.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import a, x, y\n",
      " |      >>> (3*x + a*x + 4).as_coefficients_dict()\n",
      " |      {1: 4, x: 3, a*x: 1}\n",
      " |      >>> _[a]\n",
      " |      0\n",
      " |      >>> (3*a*x).as_coefficients_dict()\n",
      " |      {a*x: 3}\n",
      " |      >>> (3*a*x).as_coefficients_dict(x)\n",
      " |      {x: 3*a}\n",
      " |      >>> (3*a*x).as_coefficients_dict(y)\n",
      " |      {1: 3*a*x}\n",
      " |  \n",
      " |  as_content_primitive(self, radical=False, clear=True)\n",
      " |      This method should recursively remove a Rational from all arguments\n",
      " |      and return that (content) and the new self (primitive). The content\n",
      " |      should always be positive and ``Mul(*foo.as_content_primitive()) == foo``.\n",
      " |      The primitive need not be in canonical form and should try to preserve\n",
      " |      the underlying structure if possible (i.e. expand_mul should not be\n",
      " |      applied to self).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sqrt\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      >>> eq = 2 + 2*x + 2*y*(3 + 3*y)\n",
      " |      \n",
      " |      The as_content_primitive function is recursive and retains structure:\n",
      " |      \n",
      " |      >>> eq.as_content_primitive()\n",
      " |      (2, x + 3*y*(y + 1) + 1)\n",
      " |      \n",
      " |      Integer powers will have Rationals extracted from the base:\n",
      " |      \n",
      " |      >>> ((2 + 6*x)**2).as_content_primitive()\n",
      " |      (4, (3*x + 1)**2)\n",
      " |      >>> ((2 + 6*x)**(2*y)).as_content_primitive()\n",
      " |      (1, (2*(3*x + 1))**(2*y))\n",
      " |      \n",
      " |      Terms may end up joining once their as_content_primitives are added:\n",
      " |      \n",
      " |      >>> ((5*(x*(1 + y)) + 2*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (11, x*(y + 1))\n",
      " |      >>> ((3*(x*(1 + y)) + 2*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (9, x*(y + 1))\n",
      " |      >>> ((3*(z*(1 + y)) + 2.0*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (1, 6.0*x*(y + 1) + 3*z*(y + 1))\n",
      " |      >>> ((5*(x*(1 + y)) + 2*x*(3 + 3*y))**2).as_content_primitive()\n",
      " |      (121, x**2*(y + 1)**2)\n",
      " |      >>> ((x*(1 + y) + 0.4*x*(3 + 3*y))**2).as_content_primitive()\n",
      " |      (1, 4.84*x**2*(y + 1)**2)\n",
      " |      \n",
      " |      Radical content can also be factored out of the primitive:\n",
      " |      \n",
      " |      >>> (2*sqrt(2) + 4*sqrt(10)).as_content_primitive(radical=True)\n",
      " |      (2, sqrt(2)*(1 + 2*sqrt(5)))\n",
      " |      \n",
      " |      If clear=False (default is True) then content will not be removed\n",
      " |      from an Add if it can be distributed to leave one or more\n",
      " |      terms with integer coefficients.\n",
      " |      \n",
      " |      >>> (x/2 + y).as_content_primitive()\n",
      " |      (1/2, x + 2*y)\n",
      " |      >>> (x/2 + y).as_content_primitive(clear=False)\n",
      " |      (1, x/2 + y)\n",
      " |  \n",
      " |  as_expr(self, *gens)\n",
      " |      Convert a polynomial to a SymPy expression.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> f = (x**2 + x*y).as_poly(x, y)\n",
      " |      >>> f.as_expr()\n",
      " |      x**2 + x*y\n",
      " |      \n",
      " |      >>> sin(x).as_expr()\n",
      " |      sin(x)\n",
      " |  \n",
      " |  as_independent(self, *deps, **hint) -> 'tuple[Expr, Expr]'\n",
      " |      A mostly naive separation of a Mul or Add into arguments that are not\n",
      " |      are dependent on deps. To obtain as complete a separation of variables\n",
      " |      as possible, use a separation method first, e.g.:\n",
      " |      \n",
      " |      * separatevars() to change Mul, Add and Pow (including exp) into Mul\n",
      " |      * .expand(mul=True) to change Add or Mul into Add\n",
      " |      * .expand(log=True) to change log expr into an Add\n",
      " |      \n",
      " |      The only non-naive thing that is done here is to respect noncommutative\n",
      " |      ordering of variables and to always return (0, 0) for `self` of zero\n",
      " |      regardless of hints.\n",
      " |      \n",
      " |      For nonzero `self`, the returned tuple (i, d) has the\n",
      " |      following interpretation:\n",
      " |      \n",
      " |      * i will has no variable that appears in deps\n",
      " |      * d will either have terms that contain variables that are in deps, or\n",
      " |        be equal to 0 (when self is an Add) or 1 (when self is a Mul)\n",
      " |      * if self is an Add then self = i + d\n",
      " |      * if self is a Mul then self = i*d\n",
      " |      * otherwise (self, S.One) or (S.One, self) is returned.\n",
      " |      \n",
      " |      To force the expression to be treated as an Add, use the hint as_Add=True\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      -- self is an Add\n",
      " |      \n",
      " |      >>> from sympy import sin, cos, exp\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      >>> (x + x*y).as_independent(x)\n",
      " |      (0, x*y + x)\n",
      " |      >>> (x + x*y).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> (2*x*sin(x) + y + x + z).as_independent(x)\n",
      " |      (y + z, 2*x*sin(x) + x)\n",
      " |      >>> (2*x*sin(x) + y + x + z).as_independent(x, y)\n",
      " |      (z, 2*x*sin(x) + x + y)\n",
      " |      \n",
      " |      -- self is a Mul\n",
      " |      \n",
      " |      >>> (x*sin(x)*cos(y)).as_independent(x)\n",
      " |      (cos(y), x*sin(x))\n",
      " |      \n",
      " |      non-commutative terms cannot always be separated out when self is a Mul\n",
      " |      \n",
      " |      >>> from sympy import symbols\n",
      " |      >>> n1, n2, n3 = symbols('n1 n2 n3', commutative=False)\n",
      " |      >>> (n1 + n1*n2).as_independent(n2)\n",
      " |      (n1, n1*n2)\n",
      " |      >>> (n2*n1 + n1*n2).as_independent(n2)\n",
      " |      (0, n1*n2 + n2*n1)\n",
      " |      >>> (n1*n2*n3).as_independent(n1)\n",
      " |      (1, n1*n2*n3)\n",
      " |      >>> (n1*n2*n3).as_independent(n2)\n",
      " |      (n1, n2*n3)\n",
      " |      >>> ((x-n1)*(x-y)).as_independent(x)\n",
      " |      (1, (x - y)*(x - n1))\n",
      " |      \n",
      " |      -- self is anything else:\n",
      " |      \n",
      " |      >>> (sin(x)).as_independent(x)\n",
      " |      (1, sin(x))\n",
      " |      >>> (sin(x)).as_independent(y)\n",
      " |      (sin(x), 1)\n",
      " |      >>> exp(x+y).as_independent(x)\n",
      " |      (1, exp(x + y))\n",
      " |      \n",
      " |      -- force self to be treated as an Add:\n",
      " |      \n",
      " |      >>> (3*x).as_independent(x, as_Add=True)\n",
      " |      (0, 3*x)\n",
      " |      \n",
      " |      -- force self to be treated as a Mul:\n",
      " |      \n",
      " |      >>> (3+x).as_independent(x, as_Add=False)\n",
      " |      (1, x + 3)\n",
      " |      >>> (-3+x).as_independent(x, as_Add=False)\n",
      " |      (1, x - 3)\n",
      " |      \n",
      " |      Note how the below differs from the above in making the\n",
      " |      constant on the dep term positive.\n",
      " |      \n",
      " |      >>> (y*(-3+x)).as_independent(x)\n",
      " |      (y, x - 3)\n",
      " |      \n",
      " |      -- use .as_independent() for true independence testing instead\n",
      " |         of .has(). The former considers only symbols in the free\n",
      " |         symbols while the latter considers all symbols\n",
      " |      \n",
      " |      >>> from sympy import Integral\n",
      " |      >>> I = Integral(x, (x, 1, 2))\n",
      " |      >>> I.has(x)\n",
      " |      True\n",
      " |      >>> x in I.free_symbols\n",
      " |      False\n",
      " |      >>> I.as_independent(x) == (I, 1)\n",
      " |      True\n",
      " |      >>> (I + x).as_independent(x) == (I, x)\n",
      " |      True\n",
      " |      \n",
      " |      Note: when trying to get independent terms, a separation method\n",
      " |      might need to be used first. In this case, it is important to keep\n",
      " |      track of what you send to this routine so you know how to interpret\n",
      " |      the returned values\n",
      " |      \n",
      " |      >>> from sympy import separatevars, log\n",
      " |      >>> separatevars(exp(x+y)).as_independent(x)\n",
      " |      (exp(y), exp(x))\n",
      " |      >>> (x + x*y).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> separatevars(x + x*y).as_independent(y)\n",
      " |      (x, y + 1)\n",
      " |      >>> (x*(1 + y)).as_independent(y)\n",
      " |      (x, y + 1)\n",
      " |      >>> (x*(1 + y)).expand(mul=True).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> a, b=symbols('a b', positive=True)\n",
      " |      >>> (log(a*b).expand(log=True)).as_independent(b)\n",
      " |      (log(a), log(b))\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      .separatevars(), .expand(log=True), sympy.core.add.Add.as_two_terms(),\n",
      " |      sympy.core.mul.Mul.as_two_terms(), .as_coeff_add(), .as_coeff_mul()\n",
      " |  \n",
      " |  as_leading_term(self, *symbols, logx=None, cdir=0)\n",
      " |      Returns the leading (nonzero) term of the series expansion of self.\n",
      " |      \n",
      " |      The _eval_as_leading_term routines are used to do this, and they must\n",
      " |      always return a non-zero value.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1 + x + x**2).as_leading_term(x)\n",
      " |      1\n",
      " |      >>> (1/x**2 + x + x**2).as_leading_term(x)\n",
      " |      x**(-2)\n",
      " |  \n",
      " |  as_numer_denom(self)\n",
      " |      expression -> a/b -> a, b\n",
      " |      \n",
      " |      This is just a stub that should be defined by\n",
      " |      an object's class methods to get anything else.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      normal: return ``a/b`` instead of ``(a, b)``\n",
      " |  \n",
      " |  as_ordered_factors(self, order=None)\n",
      " |      Return list of ordered factors (if Mul) else [self].\n",
      " |  \n",
      " |  as_ordered_terms(self, order=None, data=False)\n",
      " |      Transform an expression to an ordered list of terms.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, cos\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> (sin(x)**2*cos(x) + sin(x)**2 + 1).as_ordered_terms()\n",
      " |      [sin(x)**2*cos(x), sin(x)**2, 1]\n",
      " |  \n",
      " |  as_poly(self, *gens, **args)\n",
      " |      Converts ``self`` to a polynomial or returns ``None``.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> print((x**2 + x*y).as_poly())\n",
      " |      Poly(x**2 + x*y, x, y, domain='ZZ')\n",
      " |      \n",
      " |      >>> print((x**2 + x*y).as_poly(x, y))\n",
      " |      Poly(x**2 + x*y, x, y, domain='ZZ')\n",
      " |      \n",
      " |      >>> print((x**2 + sin(y)).as_poly(x, y))\n",
      " |      None\n",
      " |  \n",
      " |  as_powers_dict(self)\n",
      " |      Return self as a dictionary of factors with each factor being\n",
      " |      treated as a power. The keys are the bases of the factors and the\n",
      " |      values, the corresponding exponents. The resulting dictionary should\n",
      " |      be used with caution if the expression is a Mul and contains non-\n",
      " |      commutative factors since the order that they appeared will be lost in\n",
      " |      the dictionary.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      as_ordered_factors: An alternative for noncommutative applications,\n",
      " |                          returning an ordered list of factors.\n",
      " |      args_cnc: Similar to as_ordered_factors, but guarantees separation\n",
      " |                of commutative and noncommutative factors.\n",
      " |  \n",
      " |  as_real_imag(self, deep=True, **hints)\n",
      " |      Performs complex expansion on 'self' and returns a tuple\n",
      " |      containing collected both real and imaginary parts. This\n",
      " |      method cannot be confused with re() and im() functions,\n",
      " |      which does not perform complex expansion at evaluation.\n",
      " |      \n",
      " |      However it is possible to expand both re() and im()\n",
      " |      functions and get exactly the same results as with\n",
      " |      a single call to this function.\n",
      " |      \n",
      " |      >>> from sympy import symbols, I\n",
      " |      \n",
      " |      >>> x, y = symbols('x,y', real=True)\n",
      " |      \n",
      " |      >>> (x + y*I).as_real_imag()\n",
      " |      (x, y)\n",
      " |      \n",
      " |      >>> from sympy.abc import z, w\n",
      " |      \n",
      " |      >>> (z + w*I).as_real_imag()\n",
      " |      (re(z) - im(w), re(w) + im(z))\n",
      " |  \n",
      " |  as_terms(self)\n",
      " |      Transform an expression to a list of terms.\n",
      " |  \n",
      " |  aseries(self, x=None, n=6, bound=0, hir=False)\n",
      " |      Asymptotic Series expansion of self.\n",
      " |      This is equivalent to ``self.series(x, oo, n)``.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ==========\n",
      " |      \n",
      " |      self : Expression\n",
      " |             The expression whose series is to be expanded.\n",
      " |      \n",
      " |      x : Symbol\n",
      " |          It is the variable of the expression to be calculated.\n",
      " |      \n",
      " |      n : Value\n",
      " |          The value used to represent the order in terms of ``x**n``,\n",
      " |          up to which the series is to be expanded.\n",
      " |      \n",
      " |      hir : Boolean\n",
      " |            Set this parameter to be True to produce hierarchical series.\n",
      " |            It stops the recursion at an early level and may provide nicer\n",
      " |            and more useful results.\n",
      " |      \n",
      " |      bound : Value, Integer\n",
      " |              Use the ``bound`` parameter to give limit on rewriting\n",
      " |              coefficients in its normalised form.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, exp\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> e = sin(1/x + exp(-x)) - sin(1/x)\n",
      " |      \n",
      " |      >>> e.aseries(x)\n",
      " |      (1/(24*x**4) - 1/(2*x**2) + 1 + O(x**(-6), (x, oo)))*exp(-x)\n",
      " |      \n",
      " |      >>> e.aseries(x, n=3, hir=True)\n",
      " |      -exp(-2*x)*sin(1/x)/2 + exp(-x)*cos(1/x) + O(exp(-3*x), (x, oo))\n",
      " |      \n",
      " |      >>> e = exp(exp(x)/(1 - 1/x))\n",
      " |      \n",
      " |      >>> e.aseries(x)\n",
      " |      exp(exp(x)/(1 - 1/x))\n",
      " |      \n",
      " |      >>> e.aseries(x, bound=3) # doctest: +SKIP\n",
      " |      exp(exp(x)/x**2)*exp(exp(x)/x)*exp(-exp(x) + exp(x)/(1 - 1/x) - exp(x)/x - exp(x)/x**2)*exp(exp(x))\n",
      " |      \n",
      " |      For rational expressions this method may return original expression without the Order term.\n",
      " |      >>> (1/x).aseries(x, n=8)\n",
      " |      1/x\n",
      " |      \n",
      " |      Returns\n",
      " |      =======\n",
      " |      \n",
      " |      Expr\n",
      " |          Asymptotic series expansion of the expression.\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      This algorithm is directly induced from the limit computational algorithm provided by Gruntz.\n",
      " |      It majorly uses the mrv and rewrite sub-routines. The overall idea of this algorithm is first\n",
      " |      to look for the most rapidly varying subexpression w of a given expression f and then expands f\n",
      " |      in a series in w. Then same thing is recursively done on the leading coefficient\n",
      " |      till we get constant coefficients.\n",
      " |      \n",
      " |      If the most rapidly varying subexpression of a given expression f is f itself,\n",
      " |      the algorithm tries to find a normalised representation of the mrv set and rewrites f\n",
      " |      using this normalised representation.\n",
      " |      \n",
      " |      If the expansion contains an order term, it will be either ``O(x ** (-n))`` or ``O(w ** (-n))``\n",
      " |      where ``w`` belongs to the most rapidly varying expression of ``self``.\n",
      " |      \n",
      " |      References\n",
      " |      ==========\n",
      " |      \n",
      " |      .. [1] Gruntz, Dominik. A new algorithm for computing asymptotic series.\n",
      " |             In: Proc. 1993 Int. Symp. Symbolic and Algebraic Computation. 1993.\n",
      " |             pp. 239-244.\n",
      " |      .. [2] Gruntz thesis - p90\n",
      " |      .. [3] http://en.wikipedia.org/wiki/Asymptotic_expansion\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      Expr.aseries: See the docstring of this function for complete details of this wrapper.\n",
      " |  \n",
      " |  cancel(self, *gens, **args)\n",
      " |      See the cancel function in sympy.polys\n",
      " |  \n",
      " |  coeff(self, x, n=1, right=False, _first=True)\n",
      " |      Returns the coefficient from the term(s) containing ``x**n``. If ``n``\n",
      " |      is zero then all terms independent of ``x`` will be returned.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      When ``x`` is noncommutative, the coefficient to the left (default) or\n",
      " |      right of ``x`` can be returned. The keyword 'right' is ignored when\n",
      " |      ``x`` is commutative.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      You can select terms that have an explicit negative in front of them:\n",
      " |      \n",
      " |      >>> (-x + 2*y).coeff(-1)\n",
      " |      x\n",
      " |      >>> (x - 2*y).coeff(-1)\n",
      " |      2*y\n",
      " |      \n",
      " |      You can select terms with no Rational coefficient:\n",
      " |      \n",
      " |      >>> (x + 2*y).coeff(1)\n",
      " |      x\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(1)\n",
      " |      0\n",
      " |      \n",
      " |      You can select terms independent of x by making n=0; in this case\n",
      " |      expr.as_independent(x)[0] is returned (and 0 will be returned instead\n",
      " |      of None):\n",
      " |      \n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x, 0)\n",
      " |      3\n",
      " |      >>> eq = ((x + 1)**3).expand() + 1\n",
      " |      >>> eq\n",
      " |      x**3 + 3*x**2 + 3*x + 2\n",
      " |      >>> [eq.coeff(x, i) for i in reversed(range(4))]\n",
      " |      [1, 3, 3, 2]\n",
      " |      >>> eq -= 2\n",
      " |      >>> [eq.coeff(x, i) for i in reversed(range(4))]\n",
      " |      [1, 3, 3, 0]\n",
      " |      \n",
      " |      You can select terms that have a numerical term in front of them:\n",
      " |      \n",
      " |      >>> (-x - 2*y).coeff(2)\n",
      " |      -y\n",
      " |      >>> from sympy import sqrt\n",
      " |      >>> (x + sqrt(2)*x).coeff(sqrt(2))\n",
      " |      x\n",
      " |      \n",
      " |      The matching is exact:\n",
      " |      \n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x)\n",
      " |      2\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x**2)\n",
      " |      4\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x**3)\n",
      " |      0\n",
      " |      >>> (z*(x + y)**2).coeff((x + y)**2)\n",
      " |      z\n",
      " |      >>> (z*(x + y)**2).coeff(x + y)\n",
      " |      0\n",
      " |      \n",
      " |      In addition, no factoring is done, so 1 + z*(1 + y) is not obtained\n",
      " |      from the following:\n",
      " |      \n",
      " |      >>> (x + z*(x + x*y)).coeff(x)\n",
      " |      1\n",
      " |      \n",
      " |      If such factoring is desired, factor_terms can be used first:\n",
      " |      \n",
      " |      >>> from sympy import factor_terms\n",
      " |      >>> factor_terms(x + z*(x + x*y)).coeff(x)\n",
      " |      z*(y + 1) + 1\n",
      " |      \n",
      " |      >>> n, m, o = symbols('n m o', commutative=False)\n",
      " |      >>> n.coeff(n)\n",
      " |      1\n",
      " |      >>> (3*n).coeff(n)\n",
      " |      3\n",
      " |      >>> (n*m + m*n*m).coeff(n) # = (1 + m)*n*m\n",
      " |      1 + m\n",
      " |      >>> (n*m + m*n*m).coeff(n, right=True) # = (1 + m)*n*m\n",
      " |      m\n",
      " |      \n",
      " |      If there is more than one possible coefficient 0 is returned:\n",
      " |      \n",
      " |      >>> (n*m + m*n).coeff(n)\n",
      " |      0\n",
      " |      \n",
      " |      If there is only one possible coefficient, it is returned:\n",
      " |      \n",
      " |      >>> (n*m + x*m*n).coeff(m*n)\n",
      " |      x\n",
      " |      >>> (n*m + x*m*n).coeff(m*n, right=1)\n",
      " |      1\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      as_coefficient: separate the expression into a coefficient and factor\n",
      " |      as_coeff_Add: separate the additive constant from an expression\n",
      " |      as_coeff_Mul: separate the multiplicative constant from an expression\n",
      " |      as_independent: separate x-dependent terms/factors from others\n",
      " |      sympy.polys.polytools.Poly.coeff_monomial: efficiently find the single coefficient of a monomial in Poly\n",
      " |      sympy.polys.polytools.Poly.nth: like coeff_monomial but powers of monomial terms are used\n",
      " |  \n",
      " |  collect(self, syms, func=None, evaluate=True, exact=False, distribute_order_term=True)\n",
      " |      See the collect function in sympy.simplify\n",
      " |  \n",
      " |  combsimp(self)\n",
      " |      See the combsimp function in sympy.simplify\n",
      " |  \n",
      " |  compute_leading_term(self, x, logx=None)\n",
      " |      as_leading_term is only allowed for results of .series()\n",
      " |      This is a wrapper to compute a series first.\n",
      " |  \n",
      " |  conjugate(self)\n",
      " |      Returns the complex conjugate of 'self'.\n",
      " |  \n",
      " |  could_extract_minus_sign(self)\n",
      " |      Return True if self has -1 as a leading factor or has\n",
      " |      more literal negative signs than positive signs in a sum,\n",
      " |      otherwise False.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> e = x - y\n",
      " |      >>> {i.could_extract_minus_sign() for i in (e, -e)}\n",
      " |      {False, True}\n",
      " |      \n",
      " |      Though the ``y - x`` is considered like ``-(x - y)``, since it\n",
      " |      is in a product without a leading factor of -1, the result is\n",
      " |      false below:\n",
      " |      \n",
      " |      >>> (x*(y - x)).could_extract_minus_sign()\n",
      " |      False\n",
      " |      \n",
      " |      To put something in canonical form wrt to sign, use `signsimp`:\n",
      " |      \n",
      " |      >>> from sympy import signsimp\n",
      " |      >>> signsimp(x*(y - x))\n",
      " |      -x*(x - y)\n",
      " |      >>> _.could_extract_minus_sign()\n",
      " |      True\n",
      " |  \n",
      " |  count_ops(self, visual=None)\n",
      " |      wrapper for count_ops that returns the operation count.\n",
      " |  \n",
      " |  diff(self, *symbols, **assumptions)\n",
      " |  \n",
      " |  dir(self, x, cdir)\n",
      " |  \n",
      " |  equals(self, other, failing_expression=False)\n",
      " |      Return True if self == other, False if it does not, or None. If\n",
      " |      failing_expression is True then the expression which did not simplify\n",
      " |      to a 0 will be returned instead of None.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      If ``self`` is a Number (or complex number) that is not zero, then\n",
      " |      the result is False.\n",
      " |      \n",
      " |      If ``self`` is a number and has not evaluated to zero, evalf will be\n",
      " |      used to test whether the expression evaluates to zero. If it does so\n",
      " |      and the result has significance (i.e. the precision is either -1, for\n",
      " |      a Rational result, or is greater than 1) then the evalf value will be\n",
      " |      used to return True or False.\n",
      " |  \n",
      " |  expand(self, deep=True, modulus=None, power_base=True, power_exp=True, mul=True, log=True, multinomial=True, basic=True, **hints)\n",
      " |      Expand an expression using hints.\n",
      " |      \n",
      " |      See the docstring of the expand() function in sympy.core.function for\n",
      " |      more information.\n",
      " |  \n",
      " |  extract_additively(self, c)\n",
      " |      Return self - c if it's possible to subtract c from self and\n",
      " |      make all matching coefficients move towards zero, else return None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> e = 2*x + 3\n",
      " |      >>> e.extract_additively(x + 1)\n",
      " |      x + 2\n",
      " |      >>> e.extract_additively(3*x)\n",
      " |      >>> e.extract_additively(4)\n",
      " |      >>> (y*(x + 1)).extract_additively(x + 1)\n",
      " |      >>> ((x + 1)*(x + 2*y + 1) + 3).extract_additively(x + 1)\n",
      " |      (x + 1)*(x + 2*y) + 3\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      extract_multiplicatively\n",
      " |      coeff\n",
      " |      as_coefficient\n",
      " |  \n",
      " |  extract_branch_factor(self, allow_half=False)\n",
      " |      Try to write self as ``exp_polar(2*pi*I*n)*z`` in a nice way.\n",
      " |      Return (z, n).\n",
      " |      \n",
      " |      >>> from sympy import exp_polar, I, pi\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> exp_polar(I*pi).extract_branch_factor()\n",
      " |      (exp_polar(I*pi), 0)\n",
      " |      >>> exp_polar(2*I*pi).extract_branch_factor()\n",
      " |      (1, 1)\n",
      " |      >>> exp_polar(-pi*I).extract_branch_factor()\n",
      " |      (exp_polar(I*pi), -1)\n",
      " |      >>> exp_polar(3*pi*I + x).extract_branch_factor()\n",
      " |      (exp_polar(x + I*pi), 1)\n",
      " |      >>> (y*exp_polar(-5*pi*I)*exp_polar(3*pi*I + 2*pi*x)).extract_branch_factor()\n",
      " |      (y*exp_polar(2*pi*x), -1)\n",
      " |      >>> exp_polar(-I*pi/2).extract_branch_factor()\n",
      " |      (exp_polar(-I*pi/2), 0)\n",
      " |      \n",
      " |      If allow_half is True, also extract exp_polar(I*pi):\n",
      " |      \n",
      " |      >>> exp_polar(I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 1/2)\n",
      " |      >>> exp_polar(2*I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 1)\n",
      " |      >>> exp_polar(3*I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 3/2)\n",
      " |      >>> exp_polar(-I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, -1/2)\n",
      " |  \n",
      " |  extract_multiplicatively(self, c)\n",
      " |      Return None if it's not possible to make self in the form\n",
      " |      c * something in a nice way, i.e. preserving the properties\n",
      " |      of arguments of self.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols, Rational\n",
      " |      \n",
      " |      >>> x, y = symbols('x,y', real=True)\n",
      " |      \n",
      " |      >>> ((x*y)**3).extract_multiplicatively(x**2 * y)\n",
      " |      x*y**2\n",
      " |      \n",
      " |      >>> ((x*y)**3).extract_multiplicatively(x**4 * y)\n",
      " |      \n",
      " |      >>> (2*x).extract_multiplicatively(2)\n",
      " |      x\n",
      " |      \n",
      " |      >>> (2*x).extract_multiplicatively(3)\n",
      " |      \n",
      " |      >>> (Rational(1, 2)*x).extract_multiplicatively(3)\n",
      " |      x/6\n",
      " |  \n",
      " |  factor(self, *gens, **args)\n",
      " |      See the factor() function in sympy.polys.polytools\n",
      " |  \n",
      " |  fourier_series(self, limits=None)\n",
      " |      Compute fourier sine/cosine series of self.\n",
      " |      \n",
      " |      See the docstring of the :func:`fourier_series` in sympy.series.fourier\n",
      " |      for more information.\n",
      " |  \n",
      " |  fps(self, x=None, x0=0, dir=1, hyper=True, order=4, rational=True, full=False)\n",
      " |      Compute formal power power series of self.\n",
      " |      \n",
      " |      See the docstring of the :func:`fps` function in sympy.series.formal for\n",
      " |      more information.\n",
      " |  \n",
      " |  gammasimp(self)\n",
      " |      See the gammasimp function in sympy.simplify\n",
      " |  \n",
      " |  getO(self)\n",
      " |      Returns the additive O(..) symbol if there is one, else None.\n",
      " |  \n",
      " |  getn(self)\n",
      " |      Returns the order of the expression.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      The order is determined either from the O(...) term. If there\n",
      " |      is no O(...) term, it returns None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import O\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1 + x + O(x**2)).getn()\n",
      " |      2\n",
      " |      >>> (1 + x).getn()\n",
      " |  \n",
      " |  integrate(self, *args, **kwargs)\n",
      " |      See the integrate function in sympy.integrals\n",
      " |  \n",
      " |  invert(self, g, *gens, **args)\n",
      " |      Return the multiplicative inverse of ``self`` mod ``g``\n",
      " |      where ``self`` (and ``g``) may be symbolic expressions).\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      sympy.core.numbers.mod_inverse, sympy.polys.polytools.invert\n",
      " |  \n",
      " |  is_algebraic_expr(self, *syms)\n",
      " |      This tests whether a given expression is algebraic or not, in the\n",
      " |      given symbols, syms. When syms is not given, all free symbols\n",
      " |      will be used. The rational function does not have to be in expanded\n",
      " |      or in any kind of canonical form.\n",
      " |      \n",
      " |      This function returns False for expressions that are \"algebraic\n",
      " |      expressions\" with symbolic exponents. This is a simple extension to the\n",
      " |      is_rational_function, including rational exponentiation.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol, sqrt\n",
      " |      >>> x = Symbol('x', real=True)\n",
      " |      >>> sqrt(1 + x).is_rational_function()\n",
      " |      False\n",
      " |      >>> sqrt(1 + x).is_algebraic_expr()\n",
      " |      True\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be an algebraic\n",
      " |      expression to become one.\n",
      " |      \n",
      " |      >>> from sympy import exp, factor\n",
      " |      >>> a = sqrt(exp(x)**2 + 2*exp(x) + 1)/(exp(x) + 1)\n",
      " |      >>> a.is_algebraic_expr(x)\n",
      " |      False\n",
      " |      >>> factor(a).is_algebraic_expr()\n",
      " |      True\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      is_rational_function()\n",
      " |      \n",
      " |      References\n",
      " |      ==========\n",
      " |      \n",
      " |      .. [1] https://en.wikipedia.org/wiki/Algebraic_expression\n",
      " |  \n",
      " |  is_constant(self, *wrt, **flags)\n",
      " |      Return True if self is constant, False if not, or None if\n",
      " |      the constancy could not be determined conclusively.\n",
      " |      \n",
      " |      Explanation\n",
      " |      ===========\n",
      " |      \n",
      " |      If an expression has no free symbols then it is a constant. If\n",
      " |      there are free symbols it is possible that the expression is a\n",
      " |      constant, perhaps (but not necessarily) zero. To test such\n",
      " |      expressions, a few strategies are tried:\n",
      " |      \n",
      " |      1) numerical evaluation at two random points. If two such evaluations\n",
      " |      give two different values and the values have a precision greater than\n",
      " |      1 then self is not constant. If the evaluations agree or could not be\n",
      " |      obtained with any precision, no decision is made. The numerical testing\n",
      " |      is done only if ``wrt`` is different than the free symbols.\n",
      " |      \n",
      " |      2) differentiation with respect to variables in 'wrt' (or all free\n",
      " |      symbols if omitted) to see if the expression is constant or not. This\n",
      " |      will not always lead to an expression that is zero even though an\n",
      " |      expression is constant (see added test in test_expr.py). If\n",
      " |      all derivatives are zero then self is constant with respect to the\n",
      " |      given symbols.\n",
      " |      \n",
      " |      3) finding out zeros of denominator expression with free_symbols.\n",
      " |      It will not be constant if there are zeros. It gives more negative\n",
      " |      answers for expression that are not constant.\n",
      " |      \n",
      " |      If neither evaluation nor differentiation can prove the expression is\n",
      " |      constant, None is returned unless two numerical values happened to be\n",
      " |      the same and the flag ``failing_number`` is True -- in that case the\n",
      " |      numerical value will be returned.\n",
      " |      \n",
      " |      If flag simplify=False is passed, self will not be simplified;\n",
      " |      the default is True since self should be simplified before testing.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import cos, sin, Sum, S, pi\n",
      " |      >>> from sympy.abc import a, n, x, y\n",
      " |      >>> x.is_constant()\n",
      " |      False\n",
      " |      >>> S(2).is_constant()\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, 10)).is_constant()\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant()\n",
      " |      False\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(y)\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(n)\n",
      " |      False\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(x)\n",
      " |      True\n",
      " |      >>> eq = a*cos(x)**2 + a*sin(x)**2 - a\n",
      " |      >>> eq.is_constant()\n",
      " |      True\n",
      " |      >>> eq.subs({x: pi, a: 2}) == eq.subs({x: pi, a: 3}) == 0\n",
      " |      True\n",
      " |      \n",
      " |      >>> (0**x).is_constant()\n",
      " |      False\n",
      " |      >>> x.is_constant()\n",
      " |      False\n",
      " |      >>> (x**x).is_constant()\n",
      " |      False\n",
      " |      >>> one = cos(x)**2 + sin(x)**2\n",
      " |      >>> one.is_constant()\n",
      " |      True\n",
      " |      >>> ((one - 1)**(x + 1)).is_constant() in (True, False) # could be 0 or 1\n",
      " |      True\n",
      " |  \n",
      " |  is_meromorphic(self, x, a)\n",
      " |      This tests whether an expression is meromorphic as\n",
      " |      a function of the given symbol ``x`` at the point ``a``.\n",
      " |      \n",
      " |      This method is intended as a quick test that will return\n",
      " |      None if no decision can be made without simplification or\n",
      " |      more detailed analysis.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import zoo, log, sin, sqrt\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> f = 1/x**2 + 1 - 2*x**3\n",
      " |      >>> f.is_meromorphic(x, 0)\n",
      " |      True\n",
      " |      >>> f.is_meromorphic(x, 1)\n",
      " |      True\n",
      " |      >>> f.is_meromorphic(x, zoo)\n",
      " |      True\n",
      " |      \n",
      " |      >>> g = x**log(3)\n",
      " |      >>> g.is_meromorphic(x, 0)\n",
      " |      False\n",
      " |      >>> g.is_meromorphic(x, 1)\n",
      " |      True\n",
      " |      >>> g.is_meromorphic(x, zoo)\n",
      " |      False\n",
      " |      \n",
      " |      >>> h = sin(1/x)*x**2\n",
      " |      >>> h.is_meromorphic(x, 0)\n",
      " |      False\n",
      " |      >>> h.is_meromorphic(x, 1)\n",
      " |      True\n",
      " |      >>> h.is_meromorphic(x, zoo)\n",
      " |      True\n",
      " |      \n",
      " |      Multivalued functions are considered meromorphic when their\n",
      " |      branches are meromorphic. Thus most functions are meromorphic\n",
      " |      everywhere except at essential singularities and branch points.\n",
      " |      In particular, they will be meromorphic also on branch cuts\n",
      " |      except at their endpoints.\n",
      " |      \n",
      " |      >>> log(x).is_meromorphic(x, -1)\n",
      " |      True\n",
      " |      >>> log(x).is_meromorphic(x, 0)\n",
      " |      False\n",
      " |      >>> sqrt(x).is_meromorphic(x, -1)\n",
      " |      True\n",
      " |      >>> sqrt(x).is_meromorphic(x, 0)\n",
      " |      False\n",
      " |  \n",
      " |  is_polynomial(self, *syms)\n",
      " |      Return True if self is a polynomial in syms and False otherwise.\n",
      " |      \n",
      " |      This checks if self is an exact polynomial in syms.  This function\n",
      " |      returns False for expressions that are \"polynomials\" with symbolic\n",
      " |      exponents.  Thus, you should be able to apply polynomial algorithms to\n",
      " |      expressions for which this returns True, and Poly(expr, \\*syms) should\n",
      " |      work if and only if expr.is_polynomial(\\*syms) returns True. The\n",
      " |      polynomial does not have to be in expanded form.  If no symbols are\n",
      " |      given, all free symbols in the expression will be used.\n",
      " |      \n",
      " |      This is not part of the assumptions system.  You cannot do\n",
      " |      Symbol('z', polynomial=True).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol, Function\n",
      " |      >>> x = Symbol('x')\n",
      " |      >>> ((x**2 + 1)**4).is_polynomial(x)\n",
      " |      True\n",
      " |      >>> ((x**2 + 1)**4).is_polynomial()\n",
      " |      True\n",
      " |      >>> (2**x + 1).is_polynomial(x)\n",
      " |      False\n",
      " |      >>> (2**x + 1).is_polynomial(2**x)\n",
      " |      True\n",
      " |      >>> f = Function('f')\n",
      " |      >>> (f(x) + 1).is_polynomial(x)\n",
      " |      False\n",
      " |      >>> (f(x) + 1).is_polynomial(f(x))\n",
      " |      True\n",
      " |      >>> (1/f(x) + 1).is_polynomial(f(x))\n",
      " |      False\n",
      " |      \n",
      " |      >>> n = Symbol('n', nonnegative=True, integer=True)\n",
      " |      >>> (x**n + 1).is_polynomial(x)\n",
      " |      False\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be a polynomial to\n",
      " |      become one.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, factor, cancel\n",
      " |      >>> y = Symbol('y', positive=True)\n",
      " |      >>> a = sqrt(y**2 + 2*y + 1)\n",
      " |      >>> a.is_polynomial(y)\n",
      " |      False\n",
      " |      >>> factor(a)\n",
      " |      y + 1\n",
      " |      >>> factor(a).is_polynomial(y)\n",
      " |      True\n",
      " |      \n",
      " |      >>> b = (y**2 + 2*y + 1)/(y + 1)\n",
      " |      >>> b.is_polynomial(y)\n",
      " |      False\n",
      " |      >>> cancel(b)\n",
      " |      y + 1\n",
      " |      >>> cancel(b).is_polynomial(y)\n",
      " |      True\n",
      " |      \n",
      " |      See also .is_rational_function()\n",
      " |  \n",
      " |  is_rational_function(self, *syms)\n",
      " |      Test whether function is a ratio of two polynomials in the given\n",
      " |      symbols, syms. When syms is not given, all free symbols will be used.\n",
      " |      The rational function does not have to be in expanded or in any kind of\n",
      " |      canonical form.\n",
      " |      \n",
      " |      This function returns False for expressions that are \"rational\n",
      " |      functions\" with symbolic exponents.  Thus, you should be able to call\n",
      " |      .as_numer_denom() and apply polynomial algorithms to the result for\n",
      " |      expressions for which this returns True.\n",
      " |      \n",
      " |      This is not part of the assumptions system.  You cannot do\n",
      " |      Symbol('z', rational_function=True).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol, sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> (x/y).is_rational_function()\n",
      " |      True\n",
      " |      \n",
      " |      >>> (x**2).is_rational_function()\n",
      " |      True\n",
      " |      \n",
      " |      >>> (x/sin(y)).is_rational_function(y)\n",
      " |      False\n",
      " |      \n",
      " |      >>> n = Symbol('n', integer=True)\n",
      " |      >>> (x**n + 1).is_rational_function(x)\n",
      " |      False\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be a rational function\n",
      " |      to become one.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, factor\n",
      " |      >>> y = Symbol('y', positive=True)\n",
      " |      >>> a = sqrt(y**2 + 2*y + 1)/y\n",
      " |      >>> a.is_rational_function(y)\n",
      " |      False\n",
      " |      >>> factor(a)\n",
      " |      (y + 1)/y\n",
      " |      >>> factor(a).is_rational_function(y)\n",
      " |      True\n",
      " |      \n",
      " |      See also is_algebraic_expr().\n",
      " |  \n",
      " |  leadterm(self, x, logx=None, cdir=0)\n",
      " |      Returns the leading term a*x**b as a tuple (a, b).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1+x+x**2).leadterm(x)\n",
      " |      (1, 0)\n",
      " |      >>> (1/x**2+x+x**2).leadterm(x)\n",
      " |      (1, -2)\n",
      " |  \n",
      " |  limit(self, x, xlim, dir='+')\n",
      " |      Compute limit x->xlim.\n",
      " |  \n",
      " |  lseries(self, x=None, x0=0, dir='+', logx=None, cdir=0)\n",
      " |      Wrapper for series yielding an iterator of the terms of the series.\n",
      " |      \n",
      " |      Note: an infinite series will yield an infinite iterator. The following,\n",
      " |      for exaxmple, will never terminate. It will just keep printing terms\n",
      " |      of the sin(x) series::\n",
      " |      \n",
      " |        for term in sin(x).lseries(x):\n",
      " |            print term\n",
      " |      \n",
      " |      The advantage of lseries() over nseries() is that many times you are\n",
      " |      just interested in the next term in the series (i.e. the first term for\n",
      " |      example), but you do not know how many you should ask for in nseries()\n",
      " |      using the \"n\" parameter.\n",
      " |      \n",
      " |      See also nseries().\n",
      " |  \n",
      " |  normal(self)\n",
      " |      expression -> a/b\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      as_numer_denom: return ``(a, b)`` instead of ``a/b``\n",
      " |  \n",
      " |  nseries(self, x=None, x0=0, n=6, dir='+', logx=None, cdir=0)\n",
      " |      Wrapper to _eval_nseries if assumptions allow, else to series.\n",
      " |      \n",
      " |      If x is given, x0 is 0, dir='+', and self has x, then _eval_nseries is\n",
      " |      called. This calculates \"n\" terms in the innermost expressions and\n",
      " |      then builds up the final series just by \"cross-multiplying\" everything\n",
      " |      out.\n",
      " |      \n",
      " |      The optional ``logx`` parameter can be used to replace any log(x) in the\n",
      " |      returned series with a symbolic value to avoid evaluating log(x) at 0. A\n",
      " |      symbol to use in place of log(x) should be provided.\n",
      " |      \n",
      " |      Advantage -- it's fast, because we do not have to determine how many\n",
      " |      terms we need to calculate in advance.\n",
      " |      \n",
      " |      Disadvantage -- you may end up with less terms than you may have\n",
      " |      expected, but the O(x**n) term appended will always be correct and\n",
      " |      so the result, though perhaps shorter, will also be correct.\n",
      " |      \n",
      " |      If any of those assumptions is not met, this is treated like a\n",
      " |      wrapper to series which will try harder to return the correct\n",
      " |      number of terms.\n",
      " |      \n",
      " |      See also lseries().\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, log, Symbol\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> sin(x).nseries(x, 0, 6)\n",
      " |      x - x**3/6 + x**5/120 + O(x**6)\n",
      " |      >>> log(x+1).nseries(x, 0, 5)\n",
      " |      x - x**2/2 + x**3/3 - x**4/4 + O(x**5)\n",
      " |      \n",
      " |      Handling of the ``logx`` parameter --- in the following example the\n",
      " |      expansion fails since ``sin`` does not have an asymptotic expansion\n",
      " |      at -oo (the limit of log(x) as x approaches 0):\n",
      " |      \n",
      " |      >>> e = sin(log(x))\n",
      " |      >>> e.nseries(x, 0, 6)\n",
      " |      Traceback (most recent call last):\n",
      " |      ...\n",
      " |      PoleError: ...\n",
      " |      ...\n",
      " |      >>> logx = Symbol('logx')\n",
      " |      >>> e.nseries(x, 0, 6, logx=logx)\n",
      " |      sin(logx)\n",
      " |      \n",
      " |      In the following example, the expansion works but only returns self\n",
      " |      unless the ``logx`` parameter is used:\n",
      " |      \n",
      " |      >>> e = x**y\n",
      " |      >>> e.nseries(x, 0, 2)\n",
      " |      x**y\n",
      " |      >>> e.nseries(x, 0, 2, logx=logx)\n",
      " |      exp(logx*y)\n",
      " |  \n",
      " |  nsimplify(self, constants=(), tolerance=None, full=False)\n",
      " |      See the nsimplify function in sympy.simplify\n",
      " |  \n",
      " |  powsimp(self, *args, **kwargs)\n",
      " |      See the powsimp function in sympy.simplify\n",
      " |  \n",
      " |  primitive(self)\n",
      " |      Return the positive Rational that can be extracted non-recursively\n",
      " |      from every term of self (i.e., self is treated like an Add). This is\n",
      " |      like the as_coeff_Mul() method but primitive always extracts a positive\n",
      " |      Rational (never a negative or a Float).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (3*(x + 1)**2).primitive()\n",
      " |      (3, (x + 1)**2)\n",
      " |      >>> a = (6*x + 2); a.primitive()\n",
      " |      (2, 3*x + 1)\n",
      " |      >>> b = (x/2 + 3); b.primitive()\n",
      " |      (1/2, x + 6)\n",
      " |      >>> (a*b).primitive() == (1, a*b)\n",
      " |      True\n",
      " |  \n",
      " |  radsimp(self, **kwargs)\n",
      " |      See the radsimp function in sympy.simplify\n",
      " |  \n",
      " |  ratsimp(self)\n",
      " |      See the ratsimp function in sympy.simplify\n",
      " |  \n",
      " |  removeO(self)\n",
      " |      Removes the additive O(..) symbol if there is one\n",
      " |  \n",
      " |  round(self, n=None)\n",
      " |      Return x rounded to the given decimal place.\n",
      " |      \n",
      " |      If a complex number would results, apply round to the real\n",
      " |      and imaginary components of the number.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import pi, E, I, S, Number\n",
      " |      >>> pi.round()\n",
      " |      3\n",
      " |      >>> pi.round(2)\n",
      " |      3.14\n",
      " |      >>> (2*pi + E*I).round()\n",
      " |      6 + 3*I\n",
      " |      \n",
      " |      The round method has a chopping effect:\n",
      " |      \n",
      " |      >>> (2*pi + I/10).round()\n",
      " |      6\n",
      " |      >>> (pi/10 + 2*I).round()\n",
      " |      2*I\n",
      " |      >>> (pi/10 + E*I).round(2)\n",
      " |      0.31 + 2.72*I\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      The Python ``round`` function uses the SymPy ``round`` method so it\n",
      " |      will always return a SymPy number (not a Python float or int):\n",
      " |      \n",
      " |      >>> isinstance(round(S(123), -2), Number)\n",
      " |      True\n",
      " |  \n",
      " |  separate(self, deep=False, force=False)\n",
      " |      See the separate function in sympy.simplify\n",
      " |  \n",
      " |  series(self, x=None, x0=0, n=6, dir='+', logx=None, cdir=0)\n",
      " |      Series expansion of \"self\" around ``x = x0`` yielding either terms of\n",
      " |      the series one by one (the lazy series given when n=None), else\n",
      " |      all the terms at once when n != None.\n",
      " |      \n",
      " |      Returns the series expansion of \"self\" around the point ``x = x0``\n",
      " |      with respect to ``x`` up to ``O((x - x0)**n, x, x0)`` (default n is 6).\n",
      " |      \n",
      " |      If ``x=None`` and ``self`` is univariate, the univariate symbol will\n",
      " |      be supplied, otherwise an error will be raised.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ==========\n",
      " |      \n",
      " |      expr : Expression\n",
      " |             The expression whose series is to be expanded.\n",
      " |      \n",
      " |      x : Symbol\n",
      " |          It is the variable of the expression to be calculated.\n",
      " |      \n",
      " |      x0 : Value\n",
      " |           The value around which ``x`` is calculated. Can be any value\n",
      " |           from ``-oo`` to ``oo``.\n",
      " |      \n",
      " |      n : Value\n",
      " |          The value used to represent the order in terms of ``x**n``,\n",
      " |          up to which the series is to be expanded.\n",
      " |      \n",
      " |      dir : String, optional\n",
      " |            The series-expansion can be bi-directional. If ``dir=\"+\"``,\n",
      " |            then (x->x0+). If ``dir=\"-\", then (x->x0-). For infinite\n",
      " |            ``x0`` (``oo`` or ``-oo``), the ``dir`` argument is determined\n",
      " |            from the direction of the infinity (i.e., ``dir=\"-\"`` for\n",
      " |            ``oo``).\n",
      " |      \n",
      " |      logx : optional\n",
      " |             It is used to replace any log(x) in the returned series with a\n",
      " |             symbolic value rather than evaluating the actual value.\n",
      " |      \n",
      " |      cdir : optional\n",
      " |             It stands for complex direction, and indicates the direction\n",
      " |             from which the expansion needs to be evaluated.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import cos, exp, tan\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> cos(x).series()\n",
      " |      1 - x**2/2 + x**4/24 + O(x**6)\n",
      " |      >>> cos(x).series(n=4)\n",
      " |      1 - x**2/2 + O(x**4)\n",
      " |      >>> cos(x).series(x, x0=1, n=2)\n",
      " |      cos(1) - (x - 1)*sin(1) + O((x - 1)**2, (x, 1))\n",
      " |      >>> e = cos(x + exp(y))\n",
      " |      >>> e.series(y, n=2)\n",
      " |      cos(x + 1) - y*sin(x + 1) + O(y**2)\n",
      " |      >>> e.series(x, n=2)\n",
      " |      cos(exp(y)) - x*sin(exp(y)) + O(x**2)\n",
      " |      \n",
      " |      If ``n=None`` then a generator of the series terms will be returned.\n",
      " |      \n",
      " |      >>> term=cos(x).series(n=None)\n",
      " |      >>> [next(term) for i in range(2)]\n",
      " |      [1, -x**2/2]\n",
      " |      \n",
      " |      For ``dir=+`` (default) the series is calculated from the right and\n",
      " |      for ``dir=-`` the series from the left. For smooth functions this\n",
      " |      flag will not alter the results.\n",
      " |      \n",
      " |      >>> abs(x).series(dir=\"+\")\n",
      " |      x\n",
      " |      >>> abs(x).series(dir=\"-\")\n",
      " |      -x\n",
      " |      >>> f = tan(x)\n",
      " |      >>> f.series(x, 2, 6, \"+\")\n",
      " |      tan(2) + (1 + tan(2)**2)*(x - 2) + (x - 2)**2*(tan(2)**3 + tan(2)) +\n",
      " |      (x - 2)**3*(1/3 + 4*tan(2)**2/3 + tan(2)**4) + (x - 2)**4*(tan(2)**5 +\n",
      " |      5*tan(2)**3/3 + 2*tan(2)/3) + (x - 2)**5*(2/15 + 17*tan(2)**2/15 +\n",
      " |      2*tan(2)**4 + tan(2)**6) + O((x - 2)**6, (x, 2))\n",
      " |      \n",
      " |      >>> f.series(x, 2, 3, \"-\")\n",
      " |      tan(2) + (2 - x)*(-tan(2)**2 - 1) + (2 - x)**2*(tan(2)**3 + tan(2))\n",
      " |      + O((x - 2)**3, (x, 2))\n",
      " |      \n",
      " |      For rational expressions this method may return original expression without the Order term.\n",
      " |      >>> (1/x).series(x, n=8)\n",
      " |      1/x\n",
      " |      \n",
      " |      Returns\n",
      " |      =======\n",
      " |      \n",
      " |      Expr : Expression\n",
      " |          Series expansion of the expression about x0\n",
      " |      \n",
      " |      Raises\n",
      " |      ======\n",
      " |      \n",
      " |      TypeError\n",
      " |          If \"n\" and \"x0\" are infinity objects\n",
      " |      \n",
      " |      PoleError\n",
      " |          If \"x0\" is an infinity object\n",
      " |  \n",
      " |  sort_key(self, order=None)\n",
      " |      Return a sort key.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import S, I\n",
      " |      \n",
      " |      >>> sorted([S(1)/2, I, -I], key=lambda x: x.sort_key())\n",
      " |      [1/2, -I, I]\n",
      " |      \n",
      " |      >>> S(\"[x, 1/x, 1/x**2, x**2, x**(1/2), x**(1/4), x**(3/2)]\")\n",
      " |      [x, 1/x, x**(-2), x**2, sqrt(x), x**(1/4), x**(3/2)]\n",
      " |      >>> sorted(_, key=lambda x: x.sort_key())\n",
      " |      [x**(-2), 1/x, x**(1/4), sqrt(x), x, x**(3/2), x**2]\n",
      " |  \n",
      " |  taylor_term(self, n, x, *previous_terms)\n",
      " |      General method for the taylor term.\n",
      " |      \n",
      " |      This method is slow, because it differentiates n-times. Subclasses can\n",
      " |      redefine it to make it faster by using the \"previous_terms\".\n",
      " |  \n",
      " |  together(self, *args, **kwargs)\n",
      " |      See the together function in sympy.polys\n",
      " |  \n",
      " |  transpose(self)\n",
      " |  \n",
      " |  trigsimp(self, **args)\n",
      " |      See the trigsimp function in sympy.simplify\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Readonly properties inherited from sympy.core.expr.Expr:\n",
      " |  \n",
      " |  expr_free_symbols\n",
      " |      Like ``free_symbols``, but returns the free symbols only if\n",
      " |      they are contained in an expression node.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (x + y).expr_free_symbols # doctest: +SKIP\n",
      " |      {x, y}\n",
      " |      \n",
      " |      If the expression is contained in a non-expression object, do not return\n",
      " |      the free symbols. Compare:\n",
      " |      \n",
      " |      >>> from sympy import Tuple\n",
      " |      >>> t = Tuple(x + y)\n",
      " |      >>> t.expr_free_symbols # doctest: +SKIP\n",
      " |      set()\n",
      " |      >>> t.free_symbols\n",
      " |      {x, y}\n",
      " |  \n",
      " |  is_number\n",
      " |      Returns True if ``self`` has no free symbols and no\n",
      " |      undefined functions (AppliedUndef, to be precise). It will be\n",
      " |      faster than ``if not self.free_symbols``, however, since\n",
      " |      ``is_number`` will fail as soon as it hits a free symbol\n",
      " |      or undefined function.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Function, Integral, cos, sin, pi\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> f = Function('f')\n",
      " |      \n",
      " |      >>> x.is_number\n",
      " |      False\n",
      " |      >>> f(1).is_number\n",
      " |      False\n",
      " |      >>> (2*x).is_number\n",
      " |      False\n",
      " |      >>> (2 + Integral(2, x)).is_number\n",
      " |      False\n",
      " |      >>> (2 + Integral(2, (x, 1, 2))).is_number\n",
      " |      True\n",
      " |      \n",
      " |      Not all numbers are Numbers in the SymPy sense:\n",
      " |      \n",
      " |      >>> pi.is_number, pi.is_Number\n",
      " |      (True, False)\n",
      " |      \n",
      " |      If something is a number it should evaluate to a number with\n",
      " |      real and imaginary parts that are Numbers; the result may not\n",
      " |      be comparable, however, since the real and/or imaginary part\n",
      " |      of the result may not have precision.\n",
      " |      \n",
      " |      >>> cos(1).is_number and cos(1).is_comparable\n",
      " |      True\n",
      " |      \n",
      " |      >>> z = cos(1)**2 + sin(1)**2 - 1\n",
      " |      >>> z.is_number\n",
      " |      True\n",
      " |      >>> z.is_comparable\n",
      " |      False\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      sympy.core.basic.Basic.is_comparable\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from sympy.core.expr.Expr:\n",
      " |  \n",
      " |  __annotations__ = {'__slots__': 'tuple[str, ...]'}\n",
      " |  \n",
      " |  is_scalar = True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  __eq__(self, other)\n",
      " |      Return a boolean indicating whether a == b on the basis of\n",
      " |      their symbolic trees.\n",
      " |      \n",
      " |      This is the same as a.compare(b) == 0 but faster.\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      If a class that overrides __eq__() needs to retain the\n",
      " |      implementation of __hash__() from a parent class, the\n",
      " |      interpreter must be told this explicitly by setting\n",
      " |      __hash__ : Callable[[object], int] = <ParentClass>.__hash__.\n",
      " |      Otherwise the inheritance of __hash__() will be blocked,\n",
      " |      just as if __hash__ had been explicitly set to None.\n",
      " |      \n",
      " |      References\n",
      " |      ==========\n",
      " |      \n",
      " |      from http://docs.python.org/dev/reference/datamodel.html#object.__hash__\n",
      " |  \n",
      " |  __getnewargs__(self)\n",
      " |  \n",
      " |  __getstate__(self)\n",
      " |  \n",
      " |  __hash__(self) -> 'int'\n",
      " |      Return hash(self).\n",
      " |  \n",
      " |  __ne__(self, other)\n",
      " |      ``a != b``  -> Compare two symbolic trees and see whether they are different\n",
      " |      \n",
      " |      this is the same as:\n",
      " |      \n",
      " |      ``a.compare(b) != 0``\n",
      " |      \n",
      " |      but faster\n",
      " |  \n",
      " |  __reduce_ex__(self, protocol)\n",
      " |      Helper for pickle.\n",
      " |  \n",
      " |  __setstate__(self, state)\n",
      " |  \n",
      " |  as_dummy(self)\n",
      " |      Return the expression with any objects having structurally\n",
      " |      bound symbols replaced with unique, canonical symbols within\n",
      " |      the object in which they appear and having only the default\n",
      " |      assumption for commutativity being True. When applied to a\n",
      " |      symbol a new symbol having only the same commutativity will be\n",
      " |      returned.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Integral, Symbol\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> r = Symbol('r', real=True)\n",
      " |      >>> Integral(r, (r, x)).as_dummy()\n",
      " |      Integral(_0, (_0, x))\n",
      " |      >>> _.variables[0].is_real is None\n",
      " |      True\n",
      " |      >>> r.as_dummy()\n",
      " |      _r\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      Any object that has structurally bound variables should have\n",
      " |      a property, `bound_symbols` that returns those symbols\n",
      " |      appearing in the object.\n",
      " |  \n",
      " |  atoms(self, *types)\n",
      " |      Returns the atoms that form the current object.\n",
      " |      \n",
      " |      By default, only objects that are truly atomic and cannot\n",
      " |      be divided into smaller pieces are returned: symbols, numbers,\n",
      " |      and number symbols like I and pi. It is possible to request\n",
      " |      atoms of any type, however, as demonstrated below.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import I, pi, sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms()\n",
      " |      {1, 2, I, pi, x, y}\n",
      " |      \n",
      " |      If one or more types are given, the results will contain only\n",
      " |      those types of atoms.\n",
      " |      \n",
      " |      >>> from sympy import Number, NumberSymbol, Symbol\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Symbol)\n",
      " |      {x, y}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number)\n",
      " |      {1, 2}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number, NumberSymbol)\n",
      " |      {1, 2, pi}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number, NumberSymbol, I)\n",
      " |      {1, 2, I, pi}\n",
      " |      \n",
      " |      Note that I (imaginary unit) and zoo (complex infinity) are special\n",
      " |      types of number symbols and are not part of the NumberSymbol class.\n",
      " |      \n",
      " |      The type can be given implicitly, too:\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(x) # x is a Symbol\n",
      " |      {x, y}\n",
      " |      \n",
      " |      Be careful to check your assumptions when using the implicit option\n",
      " |      since ``S(1).is_Integer = True`` but ``type(S(1))`` is ``One``, a special type\n",
      " |      of SymPy atom, while ``type(S(2))`` is type ``Integer`` and will find all\n",
      " |      integers in an expression:\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(S(1))\n",
      " |      {1}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(S(2))\n",
      " |      {1, 2}\n",
      " |      \n",
      " |      Finally, arguments to atoms() can select more than atomic atoms: any\n",
      " |      SymPy type (loaded in core/__init__.py) can be listed as an argument\n",
      " |      and those types of \"atoms\" as found in scanning the arguments of the\n",
      " |      expression recursively:\n",
      " |      \n",
      " |      >>> from sympy import Function, Mul\n",
      " |      >>> from sympy.core.function import AppliedUndef\n",
      " |      >>> f = Function('f')\n",
      " |      >>> (1 + f(x) + 2*sin(y + I*pi)).atoms(Function)\n",
      " |      {f(x), sin(y + I*pi)}\n",
      " |      >>> (1 + f(x) + 2*sin(y + I*pi)).atoms(AppliedUndef)\n",
      " |      {f(x)}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Mul)\n",
      " |      {I*pi, 2*sin(y + I*pi)}\n",
      " |  \n",
      " |  compare(self, other)\n",
      " |      Return -1, 0, 1 if the object is smaller, equal, or greater than other.\n",
      " |      \n",
      " |      Not in the mathematical sense. If the object is of a different type\n",
      " |      from the \"other\" then their classes are ordered according to\n",
      " |      the sorted_classes list.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> x.compare(y)\n",
      " |      -1\n",
      " |      >>> x.compare(x)\n",
      " |      0\n",
      " |      >>> y.compare(x)\n",
      " |      1\n",
      " |  \n",
      " |  copy(self)\n",
      " |  \n",
      " |  count(self, query)\n",
      " |      Count the number of matching subexpressions.\n",
      " |  \n",
      " |  doit(self, **hints)\n",
      " |      Evaluate objects that are not evaluated by default like limits,\n",
      " |      integrals, sums and products. All objects of this kind will be\n",
      " |      evaluated recursively, unless some species were excluded via 'hints'\n",
      " |      or unless the 'deep' hint was set to 'False'.\n",
      " |      \n",
      " |      >>> from sympy import Integral\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> 2*Integral(x, x)\n",
      " |      2*Integral(x, x)\n",
      " |      \n",
      " |      >>> (2*Integral(x, x)).doit()\n",
      " |      x**2\n",
      " |      \n",
      " |      >>> (2*Integral(x, x)).doit(deep=False)\n",
      " |      2*Integral(x, x)\n",
      " |  \n",
      " |  dummy_eq(self, other, symbol=None)\n",
      " |      Compare two expressions and handle dummy symbols.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Dummy\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> u = Dummy('u')\n",
      " |      \n",
      " |      >>> (u**2 + 1).dummy_eq(x**2 + 1)\n",
      " |      True\n",
      " |      >>> (u**2 + 1) == (x**2 + 1)\n",
      " |      False\n",
      " |      \n",
      " |      >>> (u**2 + y).dummy_eq(x**2 + y, x)\n",
      " |      True\n",
      " |      >>> (u**2 + y).dummy_eq(x**2 + y, y)\n",
      " |      False\n",
      " |  \n",
      " |  find(self, query, group=False)\n",
      " |      Find all subexpressions matching a query.\n",
      " |  \n",
      " |  has(self, *patterns)\n",
      " |      Test whether any subexpression matches any of the patterns.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      >>> (x**2 + sin(x*y)).has(z)\n",
      " |      False\n",
      " |      >>> (x**2 + sin(x*y)).has(x, y, z)\n",
      " |      True\n",
      " |      >>> x.has(x)\n",
      " |      True\n",
      " |      \n",
      " |      Note ``has`` is a structural algorithm with no knowledge of\n",
      " |      mathematics. Consider the following half-open interval:\n",
      " |      \n",
      " |      >>> from sympy import Interval\n",
      " |      >>> i = Interval.Lopen(0, 5); i\n",
      " |      Interval.Lopen(0, 5)\n",
      " |      >>> i.args\n",
      " |      (0, 5, True, False)\n",
      " |      >>> i.has(4)  # there is no \"4\" in the arguments\n",
      " |      False\n",
      " |      >>> i.has(0)  # there *is* a \"0\" in the arguments\n",
      " |      True\n",
      " |      \n",
      " |      Instead, use ``contains`` to determine whether a number is in the\n",
      " |      interval or not:\n",
      " |      \n",
      " |      >>> i.contains(4)\n",
      " |      True\n",
      " |      >>> i.contains(0)\n",
      " |      False\n",
      " |      \n",
      " |      \n",
      " |      Note that ``expr.has(*patterns)`` is exactly equivalent to\n",
      " |      ``any(expr.has(p) for p in patterns)``. In particular, ``False`` is\n",
      " |      returned when the list of patterns is empty.\n",
      " |      \n",
      " |      >>> x.has()\n",
      " |      False\n",
      " |  \n",
      " |  has_free(self, *patterns)\n",
      " |      return True if self has object(s) ``x`` as a free expression\n",
      " |      else False.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Integral, Function\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> f = Function('f')\n",
      " |      >>> g = Function('g')\n",
      " |      >>> expr = Integral(f(x), (f(x), 1, g(y)))\n",
      " |      >>> expr.free_symbols\n",
      " |      {y}\n",
      " |      >>> expr.has_free(g(y))\n",
      " |      True\n",
      " |      >>> expr.has_free(*(x, f(x)))\n",
      " |      False\n",
      " |      \n",
      " |      This works for subexpressions and types, too:\n",
      " |      \n",
      " |      >>> expr.has_free(g)\n",
      " |      True\n",
      " |      >>> (x + y + 1).has_free(y + 1)\n",
      " |      True\n",
      " |  \n",
      " |  is_hypergeometric(self, k)\n",
      " |  \n",
      " |  match(self, pattern, old=False)\n",
      " |      Pattern matching.\n",
      " |      \n",
      " |      Wild symbols match all.\n",
      " |      \n",
      " |      Return ``None`` when expression (self) does not match\n",
      " |      with pattern. Otherwise return a dictionary such that::\n",
      " |      \n",
      " |        pattern.xreplace(self.match(pattern)) == self\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Wild, Sum\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> p = Wild(\"p\")\n",
      " |      >>> q = Wild(\"q\")\n",
      " |      >>> r = Wild(\"r\")\n",
      " |      >>> e = (x+y)**(x+y)\n",
      " |      >>> e.match(p**p)\n",
      " |      {p_: x + y}\n",
      " |      >>> e.match(p**q)\n",
      " |      {p_: x + y, q_: x + y}\n",
      " |      >>> e = (2*x)**2\n",
      " |      >>> e.match(p*q**r)\n",
      " |      {p_: 4, q_: x, r_: 2}\n",
      " |      >>> (p*q**r).xreplace(e.match(p*q**r))\n",
      " |      4*x**2\n",
      " |      \n",
      " |      Structurally bound symbols are ignored during matching:\n",
      " |      \n",
      " |      >>> Sum(x, (x, 1, 2)).match(Sum(y, (y, 1, p)))\n",
      " |      {p_: 2}\n",
      " |      \n",
      " |      But they can be identified if desired:\n",
      " |      \n",
      " |      >>> Sum(x, (x, 1, 2)).match(Sum(q, (q, 1, p)))\n",
      " |      {p_: 2, q_: x}\n",
      " |      \n",
      " |      The ``old`` flag will give the old-style pattern matching where\n",
      " |      expressions and patterns are essentially solved to give the\n",
      " |      match. Both of the following give None unless ``old=True``:\n",
      " |      \n",
      " |      >>> (x - 2).match(p - x, old=True)\n",
      " |      {p_: 2*x - 2}\n",
      " |      >>> (2/x).match(p*x, old=True)\n",
      " |      {p_: 2/x**2}\n",
      " |  \n",
      " |  matches(self, expr, repl_dict=None, old=False)\n",
      " |      Helper method for match() that looks for a match between Wild symbols\n",
      " |      in self and expressions in expr.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols, Wild, Basic\n",
      " |      >>> a, b, c = symbols('a b c')\n",
      " |      >>> x = Wild('x')\n",
      " |      >>> Basic(a + x, x).matches(Basic(a + b, c)) is None\n",
      " |      True\n",
      " |      >>> Basic(a + x, x).matches(Basic(a + b + c, b + c))\n",
      " |      {x_: b + c}\n",
      " |  \n",
      " |  rcall(self, *args)\n",
      " |      Apply on the argument recursively through the expression tree.\n",
      " |      \n",
      " |      This method is used to simulate a common abuse of notation for\n",
      " |      operators. For instance, in SymPy the following will not work:\n",
      " |      \n",
      " |      ``(x+Lambda(y, 2*y))(z) == x+2*z``,\n",
      " |      \n",
      " |      however, you can use:\n",
      " |      \n",
      " |      >>> from sympy import Lambda\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      >>> (x + Lambda(y, 2*y)).rcall(z)\n",
      " |      x + 2*z\n",
      " |  \n",
      " |  refine(self, assumption=True)\n",
      " |      See the refine function in sympy.assumptions\n",
      " |  \n",
      " |  replace(self, query, value, map=False, simultaneous=True, exact=None)\n",
      " |      Replace matching subexpressions of ``self`` with ``value``.\n",
      " |      \n",
      " |      If ``map = True`` then also return the mapping {old: new} where ``old``\n",
      " |      was a sub-expression found with query and ``new`` is the replacement\n",
      " |      value for it. If the expression itself does not match the query, then\n",
      " |      the returned value will be ``self.xreplace(map)`` otherwise it should\n",
      " |      be ``self.subs(ordered(map.items()))``.\n",
      " |      \n",
      " |      Traverses an expression tree and performs replacement of matching\n",
      " |      subexpressions from the bottom to the top of the tree. The default\n",
      " |      approach is to do the replacement in a simultaneous fashion so\n",
      " |      changes made are targeted only once. If this is not desired or causes\n",
      " |      problems, ``simultaneous`` can be set to False.\n",
      " |      \n",
      " |      In addition, if an expression containing more than one Wild symbol\n",
      " |      is being used to match subexpressions and the ``exact`` flag is None\n",
      " |      it will be set to True so the match will only succeed if all non-zero\n",
      " |      values are received for each Wild that appears in the match pattern.\n",
      " |      Setting this to False accepts a match of 0; while setting it True\n",
      " |      accepts all matches that have a 0 in them. See example below for\n",
      " |      cautions.\n",
      " |      \n",
      " |      The list of possible combinations of queries and replacement values\n",
      " |      is listed below:\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      Initial setup\n",
      " |      \n",
      " |      >>> from sympy import log, sin, cos, tan, Wild, Mul, Add\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> f = log(sin(x)) + tan(sin(x**2))\n",
      " |      \n",
      " |      1.1. type -> type\n",
      " |          obj.replace(type, newtype)\n",
      " |      \n",
      " |          When object of type ``type`` is found, replace it with the\n",
      " |          result of passing its argument(s) to ``newtype``.\n",
      " |      \n",
      " |          >>> f.replace(sin, cos)\n",
      " |          log(cos(x)) + tan(cos(x**2))\n",
      " |          >>> sin(x).replace(sin, cos, map=True)\n",
      " |          (cos(x), {sin(x): cos(x)})\n",
      " |          >>> (x*y).replace(Mul, Add)\n",
      " |          x + y\n",
      " |      \n",
      " |      1.2. type -> func\n",
      " |          obj.replace(type, func)\n",
      " |      \n",
      " |          When object of type ``type`` is found, apply ``func`` to its\n",
      " |          argument(s). ``func`` must be written to handle the number\n",
      " |          of arguments of ``type``.\n",
      " |      \n",
      " |          >>> f.replace(sin, lambda arg: sin(2*arg))\n",
      " |          log(sin(2*x)) + tan(sin(2*x**2))\n",
      " |          >>> (x*y).replace(Mul, lambda *args: sin(2*Mul(*args)))\n",
      " |          sin(2*x*y)\n",
      " |      \n",
      " |      2.1. pattern -> expr\n",
      " |          obj.replace(pattern(wild), expr(wild))\n",
      " |      \n",
      " |          Replace subexpressions matching ``pattern`` with the expression\n",
      " |          written in terms of the Wild symbols in ``pattern``.\n",
      " |      \n",
      " |          >>> a, b = map(Wild, 'ab')\n",
      " |          >>> f.replace(sin(a), tan(a))\n",
      " |          log(tan(x)) + tan(tan(x**2))\n",
      " |          >>> f.replace(sin(a), tan(a/2))\n",
      " |          log(tan(x/2)) + tan(tan(x**2/2))\n",
      " |          >>> f.replace(sin(a), a)\n",
      " |          log(x) + tan(x**2)\n",
      " |          >>> (x*y).replace(a*x, a)\n",
      " |          y\n",
      " |      \n",
      " |          Matching is exact by default when more than one Wild symbol\n",
      " |          is used: matching fails unless the match gives non-zero\n",
      " |          values for all Wild symbols:\n",
      " |      \n",
      " |          >>> (2*x + y).replace(a*x + b, b - a)\n",
      " |          y - 2\n",
      " |          >>> (2*x).replace(a*x + b, b - a)\n",
      " |          2*x\n",
      " |      \n",
      " |          When set to False, the results may be non-intuitive:\n",
      " |      \n",
      " |          >>> (2*x).replace(a*x + b, b - a, exact=False)\n",
      " |          2/x\n",
      " |      \n",
      " |      2.2. pattern -> func\n",
      " |          obj.replace(pattern(wild), lambda wild: expr(wild))\n",
      " |      \n",
      " |          All behavior is the same as in 2.1 but now a function in terms of\n",
      " |          pattern variables is used rather than an expression:\n",
      " |      \n",
      " |          >>> f.replace(sin(a), lambda a: sin(2*a))\n",
      " |          log(sin(2*x)) + tan(sin(2*x**2))\n",
      " |      \n",
      " |      3.1. func -> func\n",
      " |          obj.replace(filter, func)\n",
      " |      \n",
      " |          Replace subexpression ``e`` with ``func(e)`` if ``filter(e)``\n",
      " |          is True.\n",
      " |      \n",
      " |          >>> g = 2*sin(x**3)\n",
      " |          >>> g.replace(lambda expr: expr.is_Number, lambda expr: expr**2)\n",
      " |          4*sin(x**9)\n",
      " |      \n",
      " |      The expression itself is also targeted by the query but is done in\n",
      " |      such a fashion that changes are not made twice.\n",
      " |      \n",
      " |          >>> e = x*(x*y + 1)\n",
      " |          >>> e.replace(lambda x: x.is_Mul, lambda x: 2*x)\n",
      " |          2*x*(2*x*y + 1)\n",
      " |      \n",
      " |      When matching a single symbol, `exact` will default to True, but\n",
      " |      this may or may not be the behavior that is desired:\n",
      " |      \n",
      " |      Here, we want `exact=False`:\n",
      " |      \n",
      " |      >>> from sympy import Function\n",
      " |      >>> f = Function('f')\n",
      " |      >>> e = f(1) + f(0)\n",
      " |      >>> q = f(a), lambda a: f(a + 1)\n",
      " |      >>> e.replace(*q, exact=False)\n",
      " |      f(1) + f(2)\n",
      " |      >>> e.replace(*q, exact=True)\n",
      " |      f(0) + f(2)\n",
      " |      \n",
      " |      But here, the nature of matching makes selecting\n",
      " |      the right setting tricky:\n",
      " |      \n",
      " |      >>> e = x**(1 + y)\n",
      " |      >>> (x**(1 + y)).replace(x**(1 + a), lambda a: x**-a, exact=False)\n",
      " |      x\n",
      " |      >>> (x**(1 + y)).replace(x**(1 + a), lambda a: x**-a, exact=True)\n",
      " |      x**(-x - y + 1)\n",
      " |      >>> (x**y).replace(x**(1 + a), lambda a: x**-a, exact=False)\n",
      " |      x\n",
      " |      >>> (x**y).replace(x**(1 + a), lambda a: x**-a, exact=True)\n",
      " |      x**(1 - y)\n",
      " |      \n",
      " |      It is probably better to use a different form of the query\n",
      " |      that describes the target expression more precisely:\n",
      " |      \n",
      " |      >>> (1 + x**(1 + y)).replace(\n",
      " |      ... lambda x: x.is_Pow and x.exp.is_Add and x.exp.args[0] == 1,\n",
      " |      ... lambda x: x.base**(1 - (x.exp - 1)))\n",
      " |      ...\n",
      " |      x**(1 - y) + 1\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      subs: substitution of subexpressions as defined by the objects\n",
      " |            themselves.\n",
      " |      xreplace: exact node replacement in expr tree; also capable of\n",
      " |                using matching rules\n",
      " |  \n",
      " |  rewrite(self, *args, deep=True, **hints)\n",
      " |      Rewrite *self* using a defined rule.\n",
      " |      \n",
      " |      Rewriting transforms an expression to another, which is mathematically\n",
      " |      equivalent but structurally different. For example you can rewrite\n",
      " |      trigonometric functions as complex exponentials or combinatorial\n",
      " |      functions as gamma function.\n",
      " |      \n",
      " |      This method takes a *pattern* and a *rule* as positional arguments.\n",
      " |      *pattern* is optional parameter which defines the types of expressions\n",
      " |      that will be transformed. If it is not passed, all possible expressions\n",
      " |      will be rewritten. *rule* defines how the expression will be rewritten.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ==========\n",
      " |      \n",
      " |      args : *rule*, or *pattern* and *rule*.\n",
      " |          - *pattern* is a type or an iterable of types.\n",
      " |          - *rule* can be any object.\n",
      " |      \n",
      " |      deep : bool, optional.\n",
      " |          If ``True``, subexpressions are recursively transformed. Default is\n",
      " |          ``True``.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      If *pattern* is unspecified, all possible expressions are transformed.\n",
      " |      \n",
      " |      >>> from sympy import cos, sin, exp, I\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> expr = cos(x) + I*sin(x)\n",
      " |      >>> expr.rewrite(exp)\n",
      " |      exp(I*x)\n",
      " |      \n",
      " |      Pattern can be a type or an iterable of types.\n",
      " |      \n",
      " |      >>> expr.rewrite(sin, exp)\n",
      " |      exp(I*x)/2 + cos(x) - exp(-I*x)/2\n",
      " |      >>> expr.rewrite([cos,], exp)\n",
      " |      exp(I*x)/2 + I*sin(x) + exp(-I*x)/2\n",
      " |      >>> expr.rewrite([cos, sin], exp)\n",
      " |      exp(I*x)\n",
      " |      \n",
      " |      Rewriting behavior can be implemented by defining ``_eval_rewrite()``\n",
      " |      method.\n",
      " |      \n",
      " |      >>> from sympy import Expr, sqrt, pi\n",
      " |      >>> class MySin(Expr):\n",
      " |      ...     def _eval_rewrite(self, rule, args, **hints):\n",
      " |      ...         x, = args\n",
      " |      ...         if rule == cos:\n",
      " |      ...             return cos(pi/2 - x, evaluate=False)\n",
      " |      ...         if rule == sqrt:\n",
      " |      ...             return sqrt(1 - cos(x)**2)\n",
      " |      >>> MySin(MySin(x)).rewrite(cos)\n",
      " |      cos(-cos(-x + pi/2) + pi/2)\n",
      " |      >>> MySin(x).rewrite(sqrt)\n",
      " |      sqrt(1 - cos(x)**2)\n",
      " |      \n",
      " |      Defining ``_eval_rewrite_as_[...]()`` method is supported for backwards\n",
      " |      compatibility reason. This may be removed in the future and using it is\n",
      " |      discouraged.\n",
      " |      \n",
      " |      >>> class MySin(Expr):\n",
      " |      ...     def _eval_rewrite_as_cos(self, *args, **hints):\n",
      " |      ...         x, = args\n",
      " |      ...         return cos(pi/2 - x, evaluate=False)\n",
      " |      >>> MySin(x).rewrite(cos)\n",
      " |      cos(-x + pi/2)\n",
      " |  \n",
      " |  simplify(self, **kwargs)\n",
      " |      See the simplify function in sympy.simplify\n",
      " |  \n",
      " |  subs(self, *args, **kwargs)\n",
      " |      Substitutes old for new in an expression after sympifying args.\n",
      " |      \n",
      " |      `args` is either:\n",
      " |        - two arguments, e.g. foo.subs(old, new)\n",
      " |        - one iterable argument, e.g. foo.subs(iterable). The iterable may be\n",
      " |           o an iterable container with (old, new) pairs. In this case the\n",
      " |             replacements are processed in the order given with successive\n",
      " |             patterns possibly affecting replacements already made.\n",
      " |           o a dict or set whose key/value items correspond to old/new pairs.\n",
      " |             In this case the old/new pairs will be sorted by op count and in\n",
      " |             case of a tie, by number of args and the default_sort_key. The\n",
      " |             resulting sorted list is then processed as an iterable container\n",
      " |             (see previous).\n",
      " |      \n",
      " |      If the keyword ``simultaneous`` is True, the subexpressions will not be\n",
      " |      evaluated until all the substitutions have been made.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import pi, exp, limit, oo\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (1 + x*y).subs(x, pi)\n",
      " |      pi*y + 1\n",
      " |      >>> (1 + x*y).subs({x:pi, y:2})\n",
      " |      1 + 2*pi\n",
      " |      >>> (1 + x*y).subs([(x, pi), (y, 2)])\n",
      " |      1 + 2*pi\n",
      " |      >>> reps = [(y, x**2), (x, 2)]\n",
      " |      >>> (x + y).subs(reps)\n",
      " |      6\n",
      " |      >>> (x + y).subs(reversed(reps))\n",
      " |      x**2 + 2\n",
      " |      \n",
      " |      >>> (x**2 + x**4).subs(x**2, y)\n",
      " |      y**2 + y\n",
      " |      \n",
      " |      To replace only the x**2 but not the x**4, use xreplace:\n",
      " |      \n",
      " |      >>> (x**2 + x**4).xreplace({x**2: y})\n",
      " |      x**4 + y\n",
      " |      \n",
      " |      To delay evaluation until all substitutions have been made,\n",
      " |      set the keyword ``simultaneous`` to True:\n",
      " |      \n",
      " |      >>> (x/y).subs([(x, 0), (y, 0)])\n",
      " |      0\n",
      " |      >>> (x/y).subs([(x, 0), (y, 0)], simultaneous=True)\n",
      " |      nan\n",
      " |      \n",
      " |      This has the added feature of not allowing subsequent substitutions\n",
      " |      to affect those already made:\n",
      " |      \n",
      " |      >>> ((x + y)/y).subs({x + y: y, y: x + y})\n",
      " |      1\n",
      " |      >>> ((x + y)/y).subs({x + y: y, y: x + y}, simultaneous=True)\n",
      " |      y/(x + y)\n",
      " |      \n",
      " |      In order to obtain a canonical result, unordered iterables are\n",
      " |      sorted by count_op length, number of arguments and by the\n",
      " |      default_sort_key to break any ties. All other iterables are left\n",
      " |      unsorted.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, sin, cos\n",
      " |      >>> from sympy.abc import a, b, c, d, e\n",
      " |      \n",
      " |      >>> A = (sqrt(sin(2*x)), a)\n",
      " |      >>> B = (sin(2*x), b)\n",
      " |      >>> C = (cos(2*x), c)\n",
      " |      >>> D = (x, d)\n",
      " |      >>> E = (exp(x), e)\n",
      " |      \n",
      " |      >>> expr = sqrt(sin(2*x))*sin(exp(x)*x)*cos(2*x) + sin(2*x)\n",
      " |      \n",
      " |      >>> expr.subs(dict([A, B, C, D, E]))\n",
      " |      a*c*sin(d*e) + b\n",
      " |      \n",
      " |      The resulting expression represents a literal replacement of the\n",
      " |      old arguments with the new arguments. This may not reflect the\n",
      " |      limiting behavior of the expression:\n",
      " |      \n",
      " |      >>> (x**3 - 3*x).subs({x: oo})\n",
      " |      nan\n",
      " |      \n",
      " |      >>> limit(x**3 - 3*x, x, oo)\n",
      " |      oo\n",
      " |      \n",
      " |      If the substitution will be followed by numerical\n",
      " |      evaluation, it is better to pass the substitution to\n",
      " |      evalf as\n",
      " |      \n",
      " |      >>> (1/x).evalf(subs={x: 3.0}, n=21)\n",
      " |      0.333333333333333333333\n",
      " |      \n",
      " |      rather than\n",
      " |      \n",
      " |      >>> (1/x).subs({x: 3.0}).evalf(21)\n",
      " |      0.333333333333333314830\n",
      " |      \n",
      " |      as the former will ensure that the desired level of precision is\n",
      " |      obtained.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      replace: replacement capable of doing wildcard-like matching,\n",
      " |               parsing of match, and conditional replacements\n",
      " |      xreplace: exact node replacement in expr tree; also capable of\n",
      " |                using matching rules\n",
      " |      sympy.core.evalf.EvalfMixin.evalf: calculates the given formula to a desired level of precision\n",
      " |  \n",
      " |  xreplace lambda rule, **_\n",
      " |      # Function needs args so we define a property that returns\n",
      " |      # a function that takes args...and then use that function\n",
      " |      # to return the right value\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  fromiter(args, **assumptions) from sympy.core.function.FunctionClass\n",
      " |      Create a new object from an iterable.\n",
      " |      \n",
      " |      This is a convenience function that allows one to create objects from\n",
      " |      any iterable, without having to convert to a list or tuple first.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Tuple\n",
      " |      >>> Tuple.fromiter(i for i in range(5))\n",
      " |      (0, 1, 2, 3, 4)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Readonly properties inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  args\n",
      " |      Returns a tuple of arguments of 'self'.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import cot\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> cot(x).args\n",
      " |      (x,)\n",
      " |      \n",
      " |      >>> cot(x).args[0]\n",
      " |      x\n",
      " |      \n",
      " |      >>> (x*y).args\n",
      " |      (x, y)\n",
      " |      \n",
      " |      >>> (x*y).args[1]\n",
      " |      y\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      Never use self._args, always use self.args.\n",
      " |      Only use _args in __new__ when creating a new function.\n",
      " |      Do not override .args() from Basic (so that it is easy to\n",
      " |      change the interface in the future if needed).\n",
      " |  \n",
      " |  assumptions0\n",
      " |      Return object `type` assumptions.\n",
      " |      \n",
      " |      For example:\n",
      " |      \n",
      " |        Symbol('x', real=True)\n",
      " |        Symbol('x', integer=True)\n",
      " |      \n",
      " |      are different objects. In other words, besides Python type (Symbol in\n",
      " |      this case), the initial assumptions are also forming their typeinfo.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> x.assumptions0\n",
      " |      {'commutative': True}\n",
      " |      >>> x = Symbol(\"x\", positive=True)\n",
      " |      >>> x.assumptions0\n",
      " |      {'commutative': True, 'complex': True, 'extended_negative': False,\n",
      " |       'extended_nonnegative': True, 'extended_nonpositive': False,\n",
      " |       'extended_nonzero': True, 'extended_positive': True, 'extended_real':\n",
      " |       True, 'finite': True, 'hermitian': True, 'imaginary': False,\n",
      " |       'infinite': False, 'negative': False, 'nonnegative': True,\n",
      " |       'nonpositive': False, 'nonzero': True, 'positive': True, 'real':\n",
      " |       True, 'zero': False}\n",
      " |  \n",
      " |  canonical_variables\n",
      " |      Return a dictionary mapping any variable defined in\n",
      " |      ``self.bound_symbols`` to Symbols that do not clash\n",
      " |      with any free symbols in the expression.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Lambda\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> Lambda(x, 2*x).canonical_variables\n",
      " |      {x: _0}\n",
      " |  \n",
      " |  free_symbols\n",
      " |      Return from the atoms of self those which are free symbols.\n",
      " |      \n",
      " |      Not all free symbols are ``Symbol``. Eg: IndexedBase('I')[0].free_symbols\n",
      " |      \n",
      " |      For most expressions, all symbols are free symbols. For some classes\n",
      " |      this is not true. e.g. Integrals use Symbols for the dummy variables\n",
      " |      which are bound variables, so Integral has a method to return all\n",
      " |      symbols except those. Derivative keeps track of symbols with respect\n",
      " |      to which it will perform a derivative; those are\n",
      " |      bound variables, too, so it has its own free_symbols method.\n",
      " |      \n",
      " |      Any other method that uses bound variables should implement a\n",
      " |      free_symbols method.\n",
      " |  \n",
      " |  is_algebraic\n",
      " |  \n",
      " |  is_antihermitian\n",
      " |  \n",
      " |  is_commutative\n",
      " |  \n",
      " |  is_comparable\n",
      " |      Return True if self can be computed to a real number\n",
      " |      (or already is a real number) with precision, else False.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import exp_polar, pi, I\n",
      " |      >>> (I*exp_polar(I*pi/2)).is_comparable\n",
      " |      True\n",
      " |      >>> (I*exp_polar(I*pi*2)).is_comparable\n",
      " |      False\n",
      " |      \n",
      " |      A False result does not mean that `self` cannot be rewritten\n",
      " |      into a form that would be comparable. For example, the\n",
      " |      difference computed below is zero but without simplification\n",
      " |      it does not evaluate to a zero with precision:\n",
      " |      \n",
      " |      >>> e = 2**pi*(1 + 2**pi)\n",
      " |      >>> dif = e - e.expand()\n",
      " |      >>> dif.is_comparable\n",
      " |      False\n",
      " |      >>> dif.n(2)._prec\n",
      " |      1\n",
      " |  \n",
      " |  is_complex\n",
      " |  \n",
      " |  is_composite\n",
      " |  \n",
      " |  is_even\n",
      " |  \n",
      " |  is_extended_negative\n",
      " |  \n",
      " |  is_extended_nonnegative\n",
      " |  \n",
      " |  is_extended_nonpositive\n",
      " |  \n",
      " |  is_extended_nonzero\n",
      " |  \n",
      " |  is_extended_positive\n",
      " |  \n",
      " |  is_extended_real\n",
      " |  \n",
      " |  is_finite\n",
      " |  \n",
      " |  is_hermitian\n",
      " |  \n",
      " |  is_imaginary\n",
      " |  \n",
      " |  is_infinite\n",
      " |  \n",
      " |  is_integer\n",
      " |  \n",
      " |  is_irrational\n",
      " |  \n",
      " |  is_negative\n",
      " |  \n",
      " |  is_noninteger\n",
      " |  \n",
      " |  is_nonnegative\n",
      " |  \n",
      " |  is_nonpositive\n",
      " |  \n",
      " |  is_nonzero\n",
      " |  \n",
      " |  is_odd\n",
      " |  \n",
      " |  is_polar\n",
      " |  \n",
      " |  is_positive\n",
      " |  \n",
      " |  is_prime\n",
      " |  \n",
      " |  is_rational\n",
      " |  \n",
      " |  is_real\n",
      " |  \n",
      " |  is_transcendental\n",
      " |  \n",
      " |  is_zero\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  is_Add = False\n",
      " |  \n",
      " |  is_AlgebraicNumber = False\n",
      " |  \n",
      " |  is_Atom = False\n",
      " |  \n",
      " |  is_Boolean = False\n",
      " |  \n",
      " |  is_Derivative = False\n",
      " |  \n",
      " |  is_Dummy = False\n",
      " |  \n",
      " |  is_Equality = False\n",
      " |  \n",
      " |  is_Float = False\n",
      " |  \n",
      " |  is_Indexed = False\n",
      " |  \n",
      " |  is_Integer = False\n",
      " |  \n",
      " |  is_MatAdd = False\n",
      " |  \n",
      " |  is_MatMul = False\n",
      " |  \n",
      " |  is_Matrix = False\n",
      " |  \n",
      " |  is_Mul = False\n",
      " |  \n",
      " |  is_Not = False\n",
      " |  \n",
      " |  is_Number = False\n",
      " |  \n",
      " |  is_NumberSymbol = False\n",
      " |  \n",
      " |  is_Order = False\n",
      " |  \n",
      " |  is_Piecewise = False\n",
      " |  \n",
      " |  is_Point = False\n",
      " |  \n",
      " |  is_Poly = False\n",
      " |  \n",
      " |  is_Pow = False\n",
      " |  \n",
      " |  is_Rational = False\n",
      " |  \n",
      " |  is_Relational = False\n",
      " |  \n",
      " |  is_Symbol = False\n",
      " |  \n",
      " |  is_Vector = False\n",
      " |  \n",
      " |  is_Wild = False\n",
      " |  \n",
      " |  is_symbol = False\n",
      " |  \n",
      " |  kind = UndefinedKind\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.printing.defaults.Printable:\n",
      " |  \n",
      " |  __repr__ = __str__(self)\n",
      " |  \n",
      " |  __str__(self)\n",
      " |      Return str(self).\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.evalf.EvalfMixin:\n",
      " |  \n",
      " |  evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)\n",
      " |      Evaluate the given formula to an accuracy of *n* digits.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ==========\n",
      " |      \n",
      " |      subs : dict, optional\n",
      " |          Substitute numerical values for symbols, e.g.\n",
      " |          ``subs={x:3, y:1+pi}``. The substitutions must be given as a\n",
      " |          dictionary.\n",
      " |      \n",
      " |      maxn : int, optional\n",
      " |          Allow a maximum temporary working precision of maxn digits.\n",
      " |      \n",
      " |      chop : bool or number, optional\n",
      " |          Specifies how to replace tiny real or imaginary parts in\n",
      " |          subresults by exact zeros.\n",
      " |      \n",
      " |          When ``True`` the chop value defaults to standard precision.\n",
      " |      \n",
      " |          Otherwise the chop value is used to determine the\n",
      " |          magnitude of \"small\" for purposes of chopping.\n",
      " |      \n",
      " |          >>> from sympy import N\n",
      " |          >>> x = 1e-4\n",
      " |          >>> N(x, chop=True)\n",
      " |          0.000100000000000000\n",
      " |          >>> N(x, chop=1e-5)\n",
      " |          0.000100000000000000\n",
      " |          >>> N(x, chop=1e-4)\n",
      " |          0\n",
      " |      \n",
      " |      strict : bool, optional\n",
      " |          Raise ``PrecisionExhausted`` if any subresult fails to\n",
      " |          evaluate to full accuracy, given the available maxprec.\n",
      " |      \n",
      " |      quad : str, optional\n",
      " |          Choose algorithm for numerical quadrature. By default,\n",
      " |          tanh-sinh quadrature is used. For oscillatory\n",
      " |          integrals on an infinite interval, try ``quad='osc'``.\n",
      " |      \n",
      " |      verbose : bool, optional\n",
      " |          Print debug information.\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      When Floats are naively substituted into an expression,\n",
      " |      precision errors may adversely affect the result. For example,\n",
      " |      adding 1e16 (a Float) to 1 will truncate to 1e16; if 1e16 is\n",
      " |      then subtracted, the result will be 0.\n",
      " |      That is exactly what happens in the following:\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      >>> values = {x: 1e16, y: 1, z: 1e16}\n",
      " |      >>> (x + y - z).subs(values)\n",
      " |      0\n",
      " |      \n",
      " |      Using the subs argument for evalf is the accurate way to\n",
      " |      evaluate such an expression:\n",
      " |      \n",
      " |      >>> (x + y - z).evalf(subs=values)\n",
      " |      1.00000000000000\n",
      " |  \n",
      " |  n = evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(Function)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 404,
   "id": "a4a8462a",
   "metadata": {},
   "outputs": [],
   "source": [
    "from sympy.abc import n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 405,
   "id": "ac2de829",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle x^{- n} f{\\left(x \\right)}$"
      ],
      "text/plain": [
       "f(x)/x**n"
      ]
     },
     "execution_count": 405,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "expr=f(x)/x**n\n",
    "expr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 407,
   "id": "f7e45182",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{x^{- n} \\left(- n f{\\left(x \\right)} + x \\frac{d}{d x} f{\\left(x \\right)}\\right)}{x}$"
      ],
      "text/plain": [
       "(-n*f(x) + x*Derivative(f(x), x))/(x*x**n)"
      ]
     },
     "execution_count": 407,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "factor(diff(expr,x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 411,
   "id": "a5ff6af1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle 0$"
      ],
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 411,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "limit(x*ln(x),x,0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 413,
   "id": "d8209f37",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnUAAAHVCAYAAACXAw0nAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/NK7nSAAAACXBIWXMAAA9hAAAPYQGoP6dpAABNP0lEQVR4nO3dd3wUdeLG8WfTISRLCQkBQgm9l4QSBEXQCNwh+LMXigVFEUSOOwXvrHeHnp5dEBBRmlgCioIc3B1NpSWEXqUlhARIgE0jm2Qzvz/AnJEAISSZLZ/367Wvu52dMc8Ow+Zhdr7fsRiGYQgAAAAuzcvsAAAAALh2lDoAAAA3QKkDAABwA5Q6AAAAN0CpAwAAcAOUOgAAADdAqQMAAHADlDoAAAA3QKkrI8MwlJmZKeZqBgAAzohSV0ZZWVmyWq3KysoyOwo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VhKPHr27Fk1gQEAAKqAj9kBrtZ9992nY8eOFd8g+9FHH9WwYcP07bffXna7AQMGaPbs2cXP/fz8KjUnAABAVXKpUrdnzx4tX75cGzZsUI8ePSRJM2fOVExMjPbt26dWrVpdclt/f3/Vq1evqqICAABUKZf6+nX9+vWyWq3FhU6SevbsKavVqp9++umy265evVqhoaFq2bKlRo0apZMnT1Z2XAAAgCrjUmfq0tLSFBoaetHy0NBQpaWlXXK7gQMH6s4771Tjxo11+PBh/eUvf1G/fv2UkJAgf3//Urex2+2y2+3FzzMzM6/9DQAAAFQSpzhT9+KLL140kOG3j/j4eEmSxWK5aHvDMEpd/ou7775bv/vd79S+fXsNHjxY33//vfbv36+lS5decpspU6YUD8awWq2KiIi49jcKAABQSZziTN2TTz6pe+6557LrNGnSRNu3b9eJEycueu3UqVMKCwsr888LDw9X48aNdeDAgUuuM2nSJE2YMKH4eWZmJsUOAAA4LacodSEhIQoJCbniejExMbLZbNq0aZO6d+8uSdq4caNsNpt69epV5p+XkZGh5ORkhYeHX3Idf3//S341CwAA4Gyc4uvXsmrTpo0GDBigUaNGacOGDdqwYYNGjRql3//+9yVGvrZu3VqLFy+WJGVnZ2vixIlav369jhw5otWrV2vw4MEKCQnRbbfdZtZbAQAAqFAuVeokaf78+erQoYNiY2MVGxurjh07au7cuSXW2bdvn2w2myTJ29tbO3bs0JAhQ9SyZUuNGDFCLVu21Pr16xUUFGTGWwAAAKhwFsMwDLNDuILMzExZrVbZbDYFBwebHQcAAKAESl0ZGYahrKwsBQUFXXakLQAAgBkodQAAAG7A5a6pAwAAwMUodQAAAG6AUgcAAOAGKHUAAABugFIHAADgBih1AAAAboBSBwAA4AYodQAAAG6AUgcAAOAGKHUAAABu4P8BizrTck4caT0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<sympy.plotting.plot.Plot at 0x7f15ed610370>"
      ]
     },
     "execution_count": 413,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plot(x*ln(x),(x,0.1,3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 428,
   "id": "6601b1b6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\frac{\\sqrt{3}}{2}$"
      ],
      "text/plain": [
       "sqrt(3)/2"
      ]
     },
     "execution_count": 428,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sin(pi/3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6a588bfa",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9fd84dea",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
